<!DOCTYPE html><html lang="en">
      
      
        
    
    
    
    

      
      
      <head>
        <meta charset="utf-8">
        <meta name="format-detection" content="telephone=no">  
        
        <title>Lecture 5: Number Theory II | Video Lectures | Mathematics for Computer Science | Electrical Engineering and Computer Science | MIT OpenCourseWare</title>
    <!-- Begin Automatic Metadata Insertion -->
    <meta content="6-042j-mathematics-for-computer-science-fall-2010" name="WT.cg_n">
    <meta content="Lecture 5: Number Theory II" name="WT.cg_s">
    <meta content="Delves deeper into number theory, covering the basics of encryption and decryption using modular arithmetic." name="Description">
    <meta content="Leighton, Tom" name="Author">
    <meta content="Dijk, Marten van " name="Author">
    <meta content="6.042J,6.042,18.062J,18.062,number theory,encryption,Turing's code,modular arithmetic,totient function,Euler's theorem,Fermat's little theorem,RSA,Computer Science,Probability and Statistics,Applied Mathematics,Discrete Mathematics" name="keywords">
    <meta content="6.042J Mathematics for Computer Science | Lecture 5: Number Theory II" name="Search_Display">
    <meta content="Computer Science" itemprop="about">
    <meta content="Probability and Statistics" itemprop="about">
    <meta content="Applied Mathematics" itemprop="about">
    <meta content="Discrete Mathematics" itemprop="about">
    <!-- End Automatic Metadata Insertion -->

	<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/grid.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/base.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/menu.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/jquery.bubblepopup.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/search.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/courses.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/courses_new.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/jquery.jscrollpane.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/media_tabs.css">
	<link href="../../../common/xml/ocwcc.rdf" type="application/rdf+xml" rel="metadata">
	<link rel="canonical" href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-5-number-theory-ii/">
	<link rel="apple-touch-icon" href="../../../common/images/apple-touch-icon.png">
	
	
      
	
	<script type="text/javascript" src="../../../common/scripts/jquery.js"></script>
	<script type="text/javascript" src="../../../common/scripts/ocw-media-utils-offline.js"></script>
	<script type="text/javascript" src="../../../common/scripts/ocw-offline.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery.bubblepopup.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery-ui.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery.jscrollpane.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/expandy.js"></script>
	<script type="text/javascript" src="../../../common/scripts/bubble-popup-offline.js"></script>
	
	
	
    <script type="text/javascript">
      $(document).ready(function() {
        $("#tabs").tabs();
        IpadScroller();
      });
    </script>
    
    
    
    
    
    
      
       
		 

        
        
        

        
        
        
        
        
        
        
        
        
      </head>
    <body itemscope itemtype="http://schema.org/WebPage">
        
	

        <header id="top">
			<div id="grid">
				
				
					
<div id="portletwrapper-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d686561646572" class="portletWrapper kssattr-portlethash-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d686561646572">
<div class="portletStaticText portlet-static-site-header">
<!--googleoff: index-->
<div class="grid_6 alpha" id="banner"><a href="https://ocw.mit.edu/"><img src="../../../common/images/ocw_mast.png" class="logo" alt="MIT OpenCourseWare, Massachusetts Institute of Technology"></a></div>
<div class="grid_6 omega" id="subscribe">
<aside class="module" aria-label="Connect with OCW">
<table class="social">
    <tbody>
        <tr>
            <td class="socialbutton"><a aria-label="Subscribe to the OCW Newsletter" href="https://ocw.mit.edu/subscribe/index.htm?utm_source=header"><img src="../../../common/images/trans.gif" alt="An icon depicting an envelope.">Subscribe to the OCW Newsletter</a></td>
            <td>
<a aria-label="Facebook" href="https://facebook.com/mitocw"><img src="../../../common/images/icon_fb.png" alt="Click to visit our Facebook page."></a>  <a aria-label="Instagram" href="https://www.instagram.com/mitocw/"><img src="https://ocw.mit.edu/images/icon_ig.png" alt="Click to visit our Instagram page."></a> <a aria-label="Twitter" href="https://twitter.com/mitocw"><img src="https://ocw.mit.edu/images/icon_twitter.png" alt="Click to visit our Twitter feed."></a><a aria-label="YouTube" href="https://www.youtube.com/mitocw" style="font-size: 12.208px;"><img src="https://ocw.mit.edu/images/icon_yt.png" alt="Click to visit our YouTube page."></a><span style="font-size: 12.208px;">   </span><a aria-label="Open Matters blog on WordPress" href="https://www.ocw-openmatters.org/" style="font-size: 12.208px;"><img src="https://ocw.mit.edu/images/icon_wp.png" alt="Click to visit our blog on WordPress."></a>
</td>
        </tr>
    </tbody>
</table>
</aside><nav aria-label="Help Links" class="helplinks">     <a aria-label="OCW Site Help" href="https://ocw.mit.edu/help">Help</a><span aria-hidden="true">|</span>     <a href="../../../common/about/contactus.htm">Contact Us</a>   </nav>
</div>
<div class="clear"> </div>
<!--googleon: index-->
</div>

</div>

<div id="portletwrapper-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a6d6567612d6d656e75" class="portletWrapper kssattr-portlethash-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a6d6567612d6d656e75">
<div class="portletStaticText portlet-static-mega-menu"><div><nav id="mega" class="grid_8 alpha" aria-label="Site">
<ul id="menu" role="presentation">
    <li id="menu_home">
<a href="https://ocw.mit.edu/" aria-label="Homepage"><img src="../../../common/images/top-nav_home.png" class="home_icon" alt="Click for site home page."></a><!-- Begin Home Item -->
</li>
    <!-- End Home Item -->
    <li id="drop_1" aria-label="Find Courses">
<a href="#" aria-hidden="true">FIND COURSES</a><!-- Begin 5 columns Item -->
    <div class="dropdown_5columns-a mega-courses">
    <div class="col_1a">
    <div class="row_1a">
<nav aria-labelledby="mm-find-courses-by">     <span id="mm-find-courses-by" class="nav" aria-hidden="true">Find courses by:</span>
    <ul class="find_by" role="presentation">
        <li><a href="https://ocw.mit.edu/courses/find-by-topic/">Topic</a></li>
        <li><a href="https://ocw.mit.edu/courses/find-by-number/">MIT Course Number</a></li>
        <li><a href="https://ocw.mit.edu/courses/find-by-department/">Department</a></li>
    </ul>
    </nav>     <nav aria-labelledby="mm-collections">     <span id="mm-collections" class="nav" aria-hidden="true">Collections</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/new-courses/">New Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/most-visited-courses/">Most Visited Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/ocw-scholar/">OCW Scholar Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/audio-video-courses/">Audio/Video Lectures</a></li>
        <li><a href="https://ocw.mit.edu/courses/online-textbooks/">Online Textbooks</a></li>
        <li><a href="https://ocw.mit.edu/resources/">Supplemental Resources</a></li>
        <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
        <li><a href="https://ocw.mit.edu/courses/mitx-related-courseware/">MITx &amp; Related OCW Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/mit-open-learning-library/">MIT Open Learning Library</a></li>
    </ul>
    </nav>     <nav class="col_1b" aria-labelledby="mm-translated-courses">     <span id="mm-translated-courses" class="nav" aria-hidden="true" style="line-height: 1.3;">Cross-Disciplinary Topic Lists</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/energy-courses">Energy</a></li>
        <li><a href="https://ocw.mit.edu/courses/entrepreneurship">Entrepreneurship</a></li>
        <li><a href="https://ocw.mit.edu/courses/environment-courses">Environment</a></li>
        <li><a href="https://ocw.mit.edu/courses/intro-programming">Introductory Programming</a></li>
        <li><a href="https://ocw.mit.edu/courses/life-sciences">Life Sciences</a></li>
        <li><a href="https://ocw.mit.edu/courses/transportation-courses">Transportation</a></li>
    </ul>
    </nav>
</div>
    <div class="row_1b"><nav aria-labelledby="mm-cross-disciplinary-topic-lists">     <span id="mm-cross-disciplinary-topic-lists" class="nav" aria-hidden="true">Translated Courses</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/translated-courses/traditional-chinese" aria-label="Traditional Chinese">繁體字 / Traditional Chinese</a></li>
        <li><a href="https://ocw.mit.edu/courses/translated-courses/turkish" aria-label="Turkish">Türkçe / Turkish</a></li>
        <li><a href="https://ocw.mit.edu/courses/translated-courses/korean" aria-label="Korean">(비디오)한국 / Korean</a></li>
    </ul>
    </nav></div>
    </div>
    </div>
    </li>
    <li id="drop_2">
<a href="#" aria-label="For Educators">For Educators</a>
    <div class="dropdown_1column-a" style="width: 270px;"><nav aria-labelledby="mm-find-courses-by">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/educator/chalk-radio-podcast">Chalk Radio Podcast</a></li>
        <li><a href="https://ocw.mit.edu/educator/">OCW Educator Portal</a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights by Department</a></li>
        <li><a href="https://openlearning.mit.edu/campus/digital-innovations/">Residential Digital Innovations </a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/educator/additional-resources/">Additional Resources</a></li>
    </ul>
    </nav></div>
    </li>
    <li id="drop_3">
<a href="#" aria-hidden="true">Give Now</a>
    <div class="dropdown_1column-a"><nav class="col_1" aria-label="Donate">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/give/">Make a Donation</a></li>
        <li><a href="https://ocw.mit.edu/give/why-give/">Why Give?</a></li>
        <li><a href="https://ocw.mit.edu/give/our-supporters/">Our Supporters</a></li>
        <li><a href="https://ocw.mit.edu/give/other-ways-to-contribute/">Other Ways to Contribute</a></li>
        <li><a href="https://ocw.mit.edu/support/">Become a Corporate Sponsor</a></li>
    </ul>
    </nav></div>
    </li>
    <li id="drop_4">
<a href="#" aria-hidden="true">About</a>
    <div class="dropdown_1column-a"><nav class="col_1" aria-label="About">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/about/">About MIT OpenCourseWare</a></li>
        <li><a href="https://ocw.mit.edu/about/site-statistics/">Site Statistics</a></li>
        <li><a href="https://ocw.mit.edu/about/ocw-stories/">OCW Stories</a></li>
        <li><a href="https://ocw.mit.edu/about/newsletter/">Newsletter</a></li>
        <li><a href="https://chalk-radio.simplecast.com/">Chalk Radio Podcast</a></li>
        <li><a href="https://www.ocw-openmatters.org/">Open Matters Blog</a></li>
    </ul>
    </nav></div>
    </li>
</ul>
</nav></div></div>

</div>





<!--googleoff: index-->
<script>
  (function() {
	var cx = '012626166551961672889:owjdpuboktq';
	var gcse = document.createElement('script');
	gcse.type = 'text/javascript';
	gcse.async = true;
	gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(gcse, s);
  })();
  window.onload = function(){
	document.getElementById('gsc-i-id1').placeholder = 'Search';	
  };

$(document).ready(function(){

$('.advanceSearch a').keydown(function(event){showSearchTips($(this),event);})
$('#searchTipsModal').keydown(function(event){showSearchTips($(this),event);})

function showSearchTips(obj,evt) {
// if pressed enter key
	if ( evt.which == 13 || evt.which == 32) {
		showModal();
		ga('send', 'pageview', "AdvanceSearch");
		$(".advanceSearch a").attr('aria-expanded', 'true');
		$('.searchTipsModal').focus();
		evt.preventDefault();
		}
	if ( evt.which == 27 ) {
		hideModal();
		$(".advanceSearch a").attr('aria-expanded', 'false');
		var modal = document.getElementById('searchTipsModal');
		modal.style.display = "none";
		$(".advanceSearch a").focus();
		evt.preventDefault();
		}
}

});
function showModal(){
	var modal = document.getElementById('searchTipsModal');
	modal.style.display = "block";
	ga('send', 'pageview', "AdvanceSearch");
	document.getElementById("searchTipsBtn").setAttribute("aria-expanded", true);
	window.setTimeout(function () {
    document.getElementById('searchTipsModal').focus(); }, 0);
}

function hideModal(){
	var modal = document.getElementById('searchTipsModal');
	modal.style.display = "none";
	document.getElementById("searchTipsBtn").setAttribute("aria-expanded", false);
}
</script>
<div id="search" role="search" class="grid_4 omega">
    	<table class="search">
				<tbody>
					<tr>
						<td><div class="searchboxheader"><searchbox-only resultsurl="/search/ocwsearch.htm"></searchbox-only></div></td>
						<td>
							<div class="advanceSearch">
								<a id="searchTipsBtn" onclick="showModal();" href="#" role="button" aria-label="search tips" aria-expanded="false" aria-describedby="searchtips">Search Tips</a>

								<!-- The Modal -->
								<div id="searchTipsModal" class="modal" tabindex="-1">
								  <!-- Modal content -->
									<div class="modal-content">
										<div class="modal-body">
											<button class="close" onclick="hideModal();" aria-label="close">X</button>
											<span>
												<b>Exclude words from your search</b>
												<br>Put - in front of a word you want to leave out. For example, jaguar speed -car
												<br><br>
												<b>Search for an exact match</b>
												<br>Put a word or phrase inside quotes. For example, "tallest building".
												<br><br>
												<b>Search for wildcards or unknown words</b>
												<br>Put a * in your word or phrase where you want to leave a placeholder. For example, "largest * in the world".
												<br><br>
												<b>Search within a range of numbers</b>
												<br>Put .. between two numbers. For example, camera $50..$100.
												<br><br>
												<b>Combine searches</b>
												<br>Put "OR" between each search query. For example,  marathon OR race.
												<br><br>
											</span>
										</div>
								  </div>
								</div>
							</div>
						</td>
					</tr>
				</tbody>
		</table>
</div>
<div class="clear"></div>
<!--googleon: index-->
<!-- *end header* -->

				
				
			</div>
<!-- top grid end -->
		</header><!-- top end -->
			
		<div id="center_media">
      	<div id="grid">
      		<div id="left">
        		<nav id="breadcrumb_media" aria-label="Breadcrumb">
                	<p>

    <a href="https://ocw.mit.edu/">Home</a>
    
        »
        
    
    
        
            <a href="https://ocw.mit.edu/courses">Courses</a>
            
                »
                
            
            
         
    
    
        
            <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science">Electrical Engineering and Computer Science</a>
            
                »
                
            
            
         
    
    
        
            <a href="../../../contents/index.htm">Mathematics for Computer Science</a>
            
                »
                
            
            
         
    
    
        
            <a href="../../../contents/video-lectures/index.htm">Video Lectures</a>
            
                »
                
            
            
         
    
    
        
            
            
            Lecture 5: Number Theory II
         
    
</p>

            	</nav>
            	<div class="clear"></div>
        		<div id="media_title">
        		<h1 class="title" itemprop="name" property="dct:title">
        <span class="" id="parent-fieldname-title">
            Lecture 5: Number Theory II
        </span>
    </h1>
        		</div>
           		<div class="clear"></div>
           		<div id="course_wrapper_media">
           			<nav id="course_nav" aria-label="Course">
           				<script language="javascript" type="text/javascript">
function toggleMenu(objID) {
  if (!document.getElementById) return;
  var ob = document.getElementById(objID);
  ob.className = (ob.className == 'selected')?'': 'selected';
}
function toggleClass(id)
{
  var divtoggleClass= document.getElementById(id);
  divtoggleClass.className = (divtoggleClass.className == 'mO')?'mC': 'mO';
  return false;
}
function changeAlt(id)
{
  id.alt = (id.alt == 'Expand Menu')?'Collapse Menu' : 'Expand Menu';
  id.title = (id.title == 'Expand Menu')?'Collapse Menu' : 'Expand Menu';
}
</script>
<!--Left Nav Starts -->


	<ul>			  
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/index.htm">
		                  Course Home  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/syllabus/index.htm">
		                  Syllabus  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/calendar/index.htm">
		                  Calendar  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/readings/index.htm">
		                  Readings  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="selected">
			   			<a href="../../../contents/video-lectures/index.htm">
		                  Video Lectures  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/recitations/index.htm">
		                  Recitations  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/assignments/index.htm">
		                  Assignments  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/exams/index.htm">
		                  Exams  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    
		    
         	
	<!--second tal block close-->  
	
</ul>


<!--Left Nav Ends -->





           			</nav>
           			<main id="course_inner_media" aria-labelledby="media_title">
      					 
        <div class="" id="parent-fieldname-text">
            
            
        </div>
    
      					     
    
    



<script type="text/javascript">var caption_embed_1 ={'English - US': '/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-5-number-theory-ii/XX7ePR21Ook.srt'}</script>     
     <div id="media-embed">
         <div class="attention_message" id="embed_1">
<p>Flash and JavaScript are required for this feature.</p>
<p>Download the video from <a href="http://itunes.apple.com/us/itunes-u/lecture-5-number-theory-ii/id503873536?i=110644960">iTunes U</a> or the <a href="http://www.archive.org/download/MIT6.042JF10/MIT6_042JF10_lec05_300k.mp4">Internet Archive</a>.</p>
</div>
     </div>
    
     <script type="text/javascript">ocw_embed_chapter_media('embed_1', 'https://www.youtube.com/v/XX7ePR21Ook', 'youtube', '/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-5-number-theory-ii', 'https://img.youtube.com/vi/XX7ePR21Ook/0.jpg',0,0, 'https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-5-number-theory-ii/XX7ePR21Ook.srt')</script>
	 
	 
	 		
	 		<div id="transcript1"></div>
				 <script type="text/javascript">createThreePlayParams(2, 781480, "embed_1", 0, 0)</script>
			 
	

     <div id="media_resource_next_prev_nav" style="margin-top: 1em;">
        <p>
        
            <a href="../../../contents/video-lectures/lecture-4-number-theory-i/index.htm">
                <img src="../../../common/images/btn_previous_resource.png" style="margin: 0 30px 0 50px;" alt="Previous track" title="Previous track"></a>
     	
     	
        
            <a href="../../../contents/video-lectures/lecture-6-graph-theory-and-coloring/index.htm"> 
                <img src="../../../common/images/btn_next_resource.png" alt="Next track" title="Next track"></a>
       
       </p>
     </div>
 


<script type="text/javascript">
		window.onload=function(){
		init();
		
		}
		var tabLinks = new Array();
		var contentDivs = new Array();
		function init() {
		  // Grab the tab links and content divs from the page
		  var tabListItems = document.getElementById('tabs').childNodes;
		  for ( var i = 0; i < tabListItems.length; i++ ) {
			if ( tabListItems[i].nodeName == "LI" ) {
			  var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' );
			  var id = getHash( tabLink.getAttribute('href') );
			  tabLinks[id] = tabLink;
			  contentDivs[id] = document.getElementById( id );
			}
		  }
		  // Assign onclick events to the tab links, and
		  // highlight the first tab
		  var i = 0;
		  for ( var id in tabLinks ) {
			tabLinks[id].onclick = showTab;
			tabLinks[id].onfocus = function() { this.blur() };
			if ( i == 0 ) tabLinks[id].className = 'selected';
			i++;
		  }
		  // Hide all content divs except the first
		  var i = 0;
		  for ( var id in contentDivs ) {
			if ( i != 0 ) contentDivs[id].className = 'tabContent hide';
			i++;
		  }
		}
		function showTab() {
		  var selectedId = getHash( this.getAttribute('href') );
		  // Highlight the selected tab, and dim all others.
		  // Also show the selected content div, and hide all others.
		  for ( var id in contentDivs ) {
			if ( id == selectedId ) {
			  tabLinks[id].className = 'selected';
			  contentDivs[id].className = 'tabContent';
			} else {
			  tabLinks[id].className = '';
			  contentDivs[id].className = 'tabContent hide';
			}
		  }
		  // Stop the browser following the link
		  return false;
		}
		function getFirstChildWithTagName( element, tagName ) {
		  for ( var i = 0; i < element.childNodes.length; i++ ) {
			if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
		  }
		}
		function getHash( url ) {
		  var hashPos = url.lastIndexOf ( '#' );
		  return url.substring( hashPos + 1 );
		}
 </script>	
 

  <div id="media_tabs">
     
        <ul id="tabs">
            <li class="first">
                <a href="#vid_about" class="selected">About this Video</a>
            </li>
            <li class="">
                <a href="#vid_index" class="">Playlist</a>
            </li>
            <li class="">
                <a href="#vid_playlist" class="">Transcript</a>
            </li>
            <li class="">
                <a href="#vid_related" class="">Download this Video</a>
            </li>
        </ul>
   
        <div id="vid_about" itemprop="description" class="tabContent">
<p><strong>Description:</strong> Delves deeper into number theory, covering the basics of encryption and decryption using modular arithmetic.</p> <p><strong>Speaker:</strong> Marten van Dijk</p>
</div>
        <div id="vid_index" itemprop="description" class="tabContent hide">
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-1-introduction-and-proofs/index.htm">
<img src="https://img.youtube.com/vi/L3LMbpZIKhQ/default.jpg" title="Lecture 1: Introduction and Proofs" alt="Lecture 1: Introduction and Proofs">
<p>Lecture 1: Introduction and...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-2-induction/index.htm">
<img src="https://img.youtube.com/vi/z8HKWUWS-lA/default.jpg" title="Lecture 2: Induction" alt="Lecture 2: Induction">
<p>Lecture 2: Induction</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-3-strong-induction/index.htm">
<img src="https://img.youtube.com/vi/NuGDkmwEObM/default.jpg" title="Lecture 3: Strong Induction" alt="Lecture 3: Strong Induction">
<p>Lecture 3: Strong Induction</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-4-number-theory-i/index.htm">
<img src="https://img.youtube.com/vi/NuY7szYSXSw/default.jpg" title="Lecture 4: Number Theory I" alt="Lecture 4: Number Theory I">
<p>Lecture 4: Number Theory I</p></a>
</div>
<div class="related-media-thumbnail-nolink">
<div class="now-playing-resource">Now Playing</div>
<img src="https://img.youtube.com/vi/XX7ePR21Ook/default.jpg" title="Lecture 5: Number Theory II" alt="Lecture 5: Number Theory II">
<p>Lecture 5: Number Theory II</p>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-6-graph-theory-and-coloring/index.htm">
<img src="https://img.youtube.com/vi/h9wxtqoa1jY/default.jpg" title="Lecture 6: Graph Theory and Coloring" alt="Lecture 6: Graph Theory and Coloring">
<p>Lecture 6: Graph Theory and...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-7-matching-problems/index.htm">
<img src="https://img.youtube.com/vi/5RSMLgy06Ew/default.jpg" title="Lecture 7: Matching Problems" alt="Lecture 7: Matching Problems">
<p>Lecture 7: Matching Problems</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-8-graph-theory-ii-minimum-spanning-trees/index.htm">
<img src="https://img.youtube.com/vi/GJpt_3ie4WU/default.jpg" title="Lecture 8: Graph Theory II: Minimum Spanning Trees" alt="Lecture 8: Graph Theory II: Minimum Spanning Trees">
<p>Lecture 8: Graph Theory II:...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-9-communication-networks/index.htm">
<img src="https://img.youtube.com/vi/bTyxpoi2dmM/default.jpg" title="Lecture 9: Communication Networks" alt="Lecture 9: Communication Networks">
<p>Lecture 9: Communication Ne...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-10-graph-theory-iii/index.htm">
<img src="https://img.youtube.com/vi/DOIp5D7VMS4/default.jpg" title="Lecture 10: Graph Theory III" alt="Lecture 10: Graph Theory III">
<p>Lecture 10: Graph Theory III</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-11-relations-partial-orders-and-scheduling/index.htm">
<img src="https://img.youtube.com/vi/1nScXLQAQ9A/default.jpg" title="Lecture 11: Relations, Partial Orders, and Scheduling" alt="Lecture 11: Relations, Partial Orders, and Scheduling">
<p>Lecture 11: Relations, Part...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-12-sums/index.htm">
<img src="https://img.youtube.com/vi/fAeShezAGLE/default.jpg" title="Lecture 12: Sums" alt="Lecture 12: Sums">
<p>Lecture 12: Sums</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-13-sums-and-asymptotics/index.htm">
<img src="https://img.youtube.com/vi/X9eErxRjQEI/default.jpg" title="Lecture 13: Sums and Asymptotics" alt="Lecture 13: Sums and Asymptotics">
<p>Lecture 13: Sums and Asympt...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-14-divide-and-conquer-recurrences/index.htm">
<img src="https://img.youtube.com/vi/Kqf0uO0oV6s/default.jpg" title="Lecture 14: Divide and Conquer Recurrences" alt="Lecture 14: Divide and Conquer Recurrences">
<p>Lecture 14: Divide and Conq...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-15-linear-recurrences/index.htm">
<img src="https://img.youtube.com/vi/TWBB-JlmYUc/default.jpg" title="Lecture 15: Linear Recurrences" alt="Lecture 15: Linear Recurrences">
<p>Lecture 15: Linear Recurrences</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-16-counting-rules-i/index.htm">
<img src="https://img.youtube.com/vi/pNt5Ll6hGqo/default.jpg" title="Lecture 16: Counting Rules I" alt="Lecture 16: Counting Rules I">
<p>Lecture 16: Counting Rules I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-17-counting-rules-ii/index.htm">
<img src="https://img.youtube.com/vi/09yIb3VHhMI/default.jpg" title="Lecture 17: Counting Rules II" alt="Lecture 17: Counting Rules II">
<p>Lecture 17: Counting Rules II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-18-probability-introduction/index.htm">
<img src="https://img.youtube.com/vi/SmFwFdESMHI/default.jpg" title="Lecture 18: Probability Introduction" alt="Lecture 18: Probability Introduction">
<p>Lecture 18: Probability Int...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-19-conditional-probability/index.htm">
<img src="https://img.youtube.com/vi/E6FbvM-FGZ8/default.jpg" title="Lecture 19: Conditional Probability" alt="Lecture 19: Conditional Probability">
<p>Lecture 19: Conditional Pro...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-20-independence/index.htm">
<img src="https://img.youtube.com/vi/l1BCv3qqW4A/default.jpg" title="Lecture 20: Independence" alt="Lecture 20: Independence">
<p>Lecture 20: Independence</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-21-random-variables/index.htm">
<img src="https://img.youtube.com/vi/MOfhhFaQdjw/default.jpg" title="Lecture 21: Random Variables" alt="Lecture 21: Random Variables">
<p>Lecture 21: Random Variables</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-22-expectation-i/index.htm">
<img src="https://img.youtube.com/vi/gGlMSe7uEkA/default.jpg" title="Lecture 22: Expectation I" alt="Lecture 22: Expectation I">
<p>Lecture 22: Expectation I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-23-expectation-ii/index.htm">
<img src="https://img.youtube.com/vi/oI9fMUqgfxY/default.jpg" title="Lecture 23: Expectation II" alt="Lecture 23: Expectation II">
<p>Lecture 23: Expectation II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-24-large-deviations/index.htm">
<img src="https://img.youtube.com/vi/q4mwO2qS2z4/default.jpg" title="Lecture 24: Large Deviations" alt="Lecture 24: Large Deviations">
<p>Lecture 24: Large Deviations</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-25-random-walks/index.htm">
<img src="https://img.youtube.com/vi/56iFMY8QW2k/default.jpg" title="Lecture 25: Random Walks" alt="Lecture 25: Random Walks">
<p>Lecture 25: Random Walks</p></a>
</div>
</div>
        <div id="vid_playlist" itemprop="description" class="tabContent hide">
<ul><li><a class="transcript-link" title="Open in a new window." alt="Open in a new window." style="text-decoration: none; font-size: 1.0em;" target="_blank" text-decoration: none font-size: href="../../../contents/video-lectures/lecture-5-number-theory-ii/XX7ePR21Ook.pdf"> Download English-US transcript (PDF)</a></li></ul>
<p><span m="220">The</span> <span m="350">following</span> <span m="790">content</span> <span m="1380">is</span> <span m="1500">provided</span> <span m="1940">under</span> <span m="2220">a</span> <span m="2260">Creative</span> <span m="2660">Commons</span> <span m="3070">license.</span> <span m="4180">Your</span> <span m="4370">support</span> <span m="4870">will</span> <span m="5030">help</span> <span m="5270">MIT</span> <span m="5730">OpenCourseWare</span> <span m="6520">continue</span> <span m="7030">to</span> <span m="7110">offer</span> <span m="7520">high</span> <span m="7760">quality</span> <span m="8280">educational</span> <span m="8910">resources</span> <span m="9530">for</span> <span m="9680">free.</span> <span m="10880">To</span> <span m="10890">make</span> <span m="11100">a</span> <span m="11140">donation</span> <span m="11830">or</span> <span m="12100">view</span> <span m="12540">additional</span> <span m="12960">materials</span> <span m="13500">from</span> <span m="13650">hundreds</span> <span m="14080">of</span> <span m="14190">MIT</span> <span m="14620">courses,</span> <span m="15730">visit</span> <span m="15940">MIT</span> <span m="16370">OpenCourseWare</span> <span m="17410">at</span> <span m="17580">ocw.mit.edu.</span> </p>
<p><span m="23120">PROFESSOR: So</span> <span m="23340">let's</span> <span m="23560">get</span> <span m="24160">ready.</span> <span m="26280">If</span> <span m="26500">good,</span> <span m="26700">you</span> <span m="26770">should</span> <span m="27150">receive</span> <span m="27720">some</span> <span m="27930">handouts.</span> <span m="29000">So</span> <span m="29600">the</span> <span m="29700">TAs</span> <span m="29880">are</span> <span m="30230">walking</span> <span m="30570">around,</span> <span m="33810">so</span> <span m="33970">you</span> <span m="34040">should</span> <span m="34520">slowly</span> <span m="34900">get</span> <span m="35110">those.</span> <span m="36780">This</span> <span m="36950">is</span> <span m="37080">the</span> <span m="37160">second</span> <span m="37500">lecture</span> <span m="37870">on</span> <span m="38190">number</span> <span m="38570">theory,</span> <span m="38600">and</span> <span m="38730">we're</span> <span m="39020">going</span> <span m="39240">to</span> <span m="39340">cover</span> <span m="39530">for</span> <span m="39650">a</span> <span m="39700">lot</span> <span m="39920">of</span> <span m="39990">stuff.</span> <span m="40990">And</span> <span m="41140">actually,</span> <span m="41480">we're</span> <span m="41870">going to</span> <span m="41980">start</span> <span m="42510">with</span> <span m="44940">encryption,</span> <span m="45750">which</span> <span m="45950">is</span> <span m="46070">an</span> <span m="46710">application</span> <span m="47520">of</span> <span m="47760">number</span> <span m="48020">theory.</span> <span m="48540">And</span> <span m="48680">we'll</span> <span m="48890">take</span> <span m="49160">that</span> <span m="49570">as</span> <span m="49760">a</span> <span m="49830">theme</span> <span m="50120">throughout</span> <span m="50510">the</span> <span m="50580">whole</span> <span m="50790">lecture.</span> <span m="52080">And</span> <span m="52320">so,</span> <span m="52600">in</span> <span m="52680">this way, you</span> <span m="52860">can</span> <span m="52960">see</span> <span m="53420">how</span> <span m="53570">useful</span> <span m="53990">number</span> <span m="54070">theory is.</span> </p>
<p><span m="58410">Now,</span> <span m="59370">encryption--</span> <span m="60745">yeah,</span> <span m="61140">what</span> <span m="61300">is</span> <span m="61480">it?</span> <span m="62040">So</span> <span m="63130">let's</span> <span m="63330">first</span> <span m="63580">talk</span> <span m="63800">about it</span> <span m="64010">a</span> <span m="64050">little</span> <span m="64360">bit.</span> <span m="64680">Maybe</span> <span m="64980">some</span> <span m="65209">of</span> <span m="65319">you</span> <span m="65450">have</span> <span m="65580">heard</span> <span m="65820">about</span> <span m="66150">it.</span> <span m="66820">Cryptology</span> <span m="67710">in</span> <span m="67810">general</span> <span m="68260">is</span> <span m="68400">the</span> <span m="68530">art</span> <span m="68800">of</span> <span m="68890">hiding</span> <span m="69860">information.</span> <span m="71100">And</span> <span m="71250">encryption</span> <span m="71690">is</span> <span m="71930">a</span> <span m="72030">very</span> <span m="72120">useful</span> <span m="72480">tool.</span> <span m="73660">I'll</span> <span m="73870">only</span> <span m="74080">give</span> <span m="74250">a</span> <span m="74280">very</span> <span m="74520">high</span> <span m="74700">level</span> <span m="74980">overview.</span> <span m="75420">I</span> <span m="75440">mean,</span> <span m="75810">if</span> <span m="75960">you</span> <span m="76060">really</span> <span m="76230">want</span> <span m="76370">to</span> <span m="76460">know</span> <span m="76570">more</span> <span m="76790">about</span> <span m="77070">this,</span> <span m="77220">you</span> <span m="77300">should</span> <span m="77470">do</span> <span m="77580">a</span> <span m="77670">class</span> <span m="78300">in</span> <span m="78640">crypto,</span> <span m="79120">or</span> <span m="80170">practical</span> <span m="80570">security.</span> <span m="82600">So</span> <span m="82790">what's</span> <span m="82990">encryption?</span> </p>
<p><span m="89520">The</span> <span m="89640">idea</span> <span m="89980">is</span> <span m="90060">usually</span> <span m="90450">that,</span> <span m="90600">beforehand,</span> <span m="92700">we're</span> <span m="92970">going</span> <span m="93200">to</span> <span m="93340">share</span> <span m="96080">a</span> <span m="96160">whole</span> <span m="96380">bunch</span> <span m="96900">of</span> <span m="97070">keys.</span> <span m="99490">So</span> <span m="99640">keys</span> <span m="100030">are</span> <span m="101860">exchanged</span> <span m="105550">between</span> <span m="105900">a</span> <span m="106010">receiver</span> <span m="106420">and</span> <span m="106630">a</span> <span m="106700">sender.</span> <span m="107370">And</span> <span m="107530">the</span> <span m="107580">whole</span> <span m="107810">idea</span> <span m="108240">is</span> <span m="108830">that</span> <span m="109370">if</span> <span m="109620">I</span> <span m="109810">want</span> <span m="110050">to</span> <span m="110170">transmit,</span> <span m="110820">like,</span> <span m="111140">a</span> <span m="111170">message</span> <span m="111800">to</span> <span m="111960">one</span> <span m="112140">of</span> <span m="112230">you,</span> <span m="113480">well,</span> <span m="114280">there</span> <span m="114380">could</span> <span m="114580">be</span> <span m="114670">someone</span> <span m="115810">in</span> <span m="115980">the</span> <span m="116060">middle</span> <span m="116450">who</span> <span m="116820">wants</span> <span m="117030">to</span> <span m="117120">intercept</span> <span m="117580">my</span> <span m="118300">message,</span> <span m="119130">and</span> <span m="119320">wants</span> <span m="119560">to</span> <span m="119790">find</span> <span m="120090">out</span> <span m="120270">what</span> <span m="120420">I'm</span> <span m="120540">saying.</span> <span m="121060">So</span> <span m="121230">I do</span> <span m="121350">not</span> <span m="121490">like</span> <span m="121790">this.</span> <span m="122690">And</span> <span m="123010">in</span> <span m="123180">order</span> <span m="123380">to</span> <span m="123670">avoid</span> <span m="124140">it,</span> <span m="125310">I</span> <span m="125440">will</span> <span m="125590">use</span> <span m="126030">encryption,</span> <span m="127560">which</span> <span m="127800">is</span> <span m="127900">some</span> <span m="128419">kind</span> <span m="128650">of</span> <span m="128800">algorithm</span> <span m="129850">that</span> <span m="130410">actually</span> <span m="131650">transforms</span> <span m="133600">my</span> <span m="134010">message</span> <span m="134490">m--</span> <span m="135030">my</span> <span m="135170">plain</span> <span m="135510">message--</span> <span m="137300">by</span> <span m="137480">using</span> <span m="137790">some</span> <span m="137990">kind</span> <span m="138260">of</span> <span m="138410">algorithm,</span> <span m="139090">E.</span> <span m="139450">Some</span> <span m="139630">encryption</span> <span m="140660">algorithm--</span> <span m="141800">it</span> <span m="141930">can</span> <span m="142070">be</span> <span m="142220">a</span> <span m="142270">function</span> <span m="142680">as</span> <span m="142820">well--</span> <span m="144650">that</span> <span m="144870">uses</span> <span m="145550">the</span> <span m="145730">keys</span> <span m="146760">in</span> <span m="146970">order</span> <span m="147220">to</span> <span m="149630">transform</span> <span m="150520">this</span> <span m="150720">into</span> <span m="151030">an</span> <span m="151140">encryption,</span> <span m="151810">which</span> <span m="152040">we call</span> <span m="152370">m</span> <span m="152540">prime</span> <span m="152870">here.</span> </p>
<p><span m="153850">So the</span> <span m="154350">plain</span> <span m="154590">text</span> <span m="156350">is,</span> <span m="156690">in</span> <span m="157090">the clear,</span> <span m="157390">all</span> <span m="157610">the</span> <span m="157730">information</span> <span m="158370">that</span> <span m="158560">I</span> <span m="158650">want</span> <span m="158880">to</span> <span m="159040">convey</span> <span m="159420">to</span> <span m="159640">one</span> <span m="159830">of</span> <span m="159950">you,</span> <span m="160400">for</span> <span m="160430">example.</span> <span m="161260">And</span> <span m="161910">m</span> <span m="162150">prime</span> <span m="162730">is</span> <span m="162900">somehow</span> <span m="164330">a</span> <span m="164480">complete--</span> <span m="168010">well,</span> <span m="168480">a</span> <span m="168960">mixture</span> <span m="169230">of</span> <span m="169320">bits,</span> <span m="170880">out</span> <span m="171070">of</span> <span m="171220">which</span> <span m="171660">I'm</span> <span m="171940">not</span> <span m="172190">able</span> <span m="173090">to</span> <span m="173300">distill</span> <span m="173800">any</span> <span m="174030">information</span> <span m="174530">about</span> <span m="174750">the</span> <span m="174830">plain</span> <span m="175050">text.</span> <span m="175240">So</span> <span m="175360">encryption</span> <span m="175810">to</span> <span m="175930">a very</span> <span m="176520">special</span> <span m="177520">kind</span> <span m="177750">of</span> <span m="177890">thing.</span> <span m="178080">We're</span> <span m="178260">not</span> <span m="178450">going</span> <span m="178610">to</span> <span m="178710">talk</span> <span m="178940">about</span> <span m="179160">the</span> <span m="179330">precise</span> <span m="179820">definitions</span> <span m="180480">here,</span> <span m="181420">but</span> <span m="181540">we just</span> <span m="182040">take the</span> <span m="182410">ID</span> <span m="182940">into</span> <span m="183960">this</span> <span m="184390">lecture.</span> </p>
<p><span m="185650">Now,</span> <span m="185790">decryption</span> <span m="187170">is</span> <span m="188230">transforming</span> <span m="189260">the</span> <span m="189760">cypher</span> <span m="190300">text</span> <span m="190630">back</span> <span m="190810">into</span> <span m="190970">the</span> <span m="191050">plain</span> <span m="191330">text.</span> <span m="191830">So</span> <span m="192140">we</span> <span m="192310">will</span> <span m="192690">start</span> <span m="193150">with</span> <span m="194190">the</span> <span m="194600">encryption,</span> <span m="195960">m</span> <span m="196150">prime,</span> <span m="197190">and</span> <span m="197580">we</span> <span m="197620">have</span> <span m="197790">some</span> <span m="197970">kind</span> <span m="198180">of</span> <span m="198270">decryption</span> <span m="198770">algorithm.</span> <span m="199820">And</span> <span m="200160">again,</span> <span m="200710">we</span> <span m="200830">can</span> <span m="201100">make</span> <span m="201350">use</span> <span m="201610">of</span> <span m="201770">the</span> <span m="201870">keys</span> <span m="202430">we</span> <span m="202530">exchanged.</span> <span m="204050">And</span> <span m="204960">we</span> <span m="205090">transform</span> <span m="205700">it</span> <span m="205810">back</span> <span m="206150">into</span> <span m="206670">the</span> <span m="206780">plain</span> <span m="207090">message.</span> <span m="207910">So</span> <span m="208250">only</span> <span m="208630">if</span> <span m="208790">I</span> <span m="208870">know</span> <span m="209060">the</span> <span m="209170">keys,</span> <span m="209760">I</span> <span m="209880">can</span> <span m="210090">actually</span> <span m="210340">transform</span> <span m="210920">back</span> <span m="211240">the</span> <span m="211360">encrypted</span> <span m="212380">version</span> <span m="212930">into</span> <span m="213170">the</span> <span m="213280">plain</span> <span m="213820">version.</span> <span m="215060">So</span> <span m="215365">in</span> <span m="216490">encryption</span> <span m="216930">schemes</span> <span m="217290">we</span> <span m="217500">like</span> <span m="217800">both</span> <span m="218120">these</span> <span m="218430">algorithms</span> <span m="218980">to</span> <span m="219060">be</span> <span m="219210">is</span> <span m="220040">really</span> <span m="220310">efficient.</span> <span m="221430">And</span> <span m="222760">the</span> <span m="222860">security</span> <span m="223560">of</span> <span m="223630">such</span> <span m="223890">a</span> <span m="223940">scheme--</span> <span m="224260">well, the</span> <span m="224670">first</span> <span m="225430">kind</span> <span m="225680">of</span> <span m="226060">intuition</span> <span m="226340">that</span> <span m="226720">we</span> <span m="226800">can</span> <span m="226980">get</span> <span m="227610">is</span> <span m="228160">well,</span> <span m="228780">if</span> <span m="230060">I'm</span> <span m="230380">a</span> <span m="230460">man</span> <span m="230710">in</span> <span m="230790">the</span> <span m="230840">middle</span> <span m="231180">somewhere,</span> <span m="231800">intercepting</span> <span m="233190">an</span> <span m="233400">encrypted</span> <span m="233920">message--</span> <span m="234750">m</span> <span m="234930">prime--</span> <span m="235740">I</span> <span m="235860">should</span> <span m="236100">not</span> <span m="236270">be</span> <span m="236440">able</span> <span m="236910">to</span> <span m="237170">get</span> <span m="237430">any</span> <span m="237730">information</span> <span m="238300">about</span> <span m="238570">m</span> <span m="238840">if</span> <span m="239030">I</span> <span m="239120">have</span> <span m="239320">no</span> <span m="239540">knowledge</span> <span m="239950">about</span> <span m="240200">those</span> <span m="240450">keys.</span> </p>
<p><span m="242400">So</span> <span m="242630">this</span> <span m="242870">is</span> <span m="244390">the</span> <span m="244750">example</span> <span m="245220">that we're going</span> <span m="245720">to</span> <span m="245830">take</span> <span m="246100">throughout</span> <span m="246580">this</span> <span m="246740">whole</span> <span m="247310">lecture.</span> <span m="250160">So</span> <span m="250620">let's</span> <span m="250920">start</span> <span m="251350">with</span> <span m="253020">a</span> <span m="253130">first</span> <span m="255430">possible</span> <span m="255800">scheme.</span> <span m="257440">Turing,</span> <span m="257930">who</span> <span m="258450">lived</span> <span m="260430">around</span> <span m="261800">1936--</span> <span m="264040">he</span> <span m="264130">was</span> <span m="264290">24</span> <span m="264800">years</span> <span m="265070">old--</span> <span m="265380">and</span> <span m="266080">he</span> <span m="266240">lived</span> <span m="266550">to</span> <span m="268080">about--</span> <span m="269010">actually,</span> <span m="269760">I</span> <span m="269810">think</span> <span m="270040">he</span> <span m="270130">was</span> <span m="270270">about</span> <span m="270690">54</span> <span m="271440">when</span> <span m="271570">he</span> <span m="271670">died.</span> <span m="272780">In</span> <span m="272900">any</span> <span m="273080">case,</span> <span m="273340">Turing</span> <span m="274110">was</span> <span m="274330">the</span> <span m="274440">one</span> <span m="274610">who</span> <span m="274770">first</span> <span m="275320">originally</span> <span m="275780">proposed</span> <span m="277600">to</span> <span m="277750">use</span> <span m="278020">number</span> <span m="278290">theory</span> <span m="279220">in</span> <span m="279450">cryptography.</span> <span m="280350">And</span> <span m="281870">before</span> <span m="282220">he</span> <span m="282280">joined</span> <span m="282560">the</span> <span m="282620">British</span> <span m="282970">army,</span> <span m="283290">before the</span> <span m="283740">Second</span> <span m="284050">World</span> <span m="284280">War,</span> <span m="284560">he</span> <span m="284750">actually</span> <span m="287460">proposed</span> <span m="288220">a</span> <span m="288310">scheme,</span> <span m="289270">but</span> <span m="289400">it</span> <span m="289480">got</span> <span m="289650">never</span> <span m="289900">published.</span> <span m="290700">So</span> <span m="290940">here</span> <span m="291060">in</span> <span m="291130">this</span> <span m="291320">class,</span> <span m="291850">we</span> <span m="292020">are</span> <span m="292170">going</span> <span m="292480">to</span> <span m="293540">try</span> <span m="293820">to</span> <span m="293980">think</span> <span m="294330">about</span> <span m="294670">what</span> <span m="294810">he</span> <span m="294950">could</span> <span m="295140">have</span> <span m="295310">thought</span> <span m="295550">about.</span> </p>
<p><span m="296000">So</span> <span m="296540">we</span> <span m="296660">will</span> <span m="296750">have</span> <span m="296890">a</span> <span m="296980">first</span> <span m="297700">scheme,</span> <span m="299330">which</span> <span m="299540">we</span> <span m="299790">will</span> <span m="299880">call</span> <span m="300160">Turing's</span> <span m="300530">code,</span> <span m="302370">version</span> <span m="302660">number</span> <span m="302890">one.</span> <span m="304510">And</span> <span m="305290">the</span> <span m="305420">whole</span> <span m="305670">idea</span> <span m="306090">is</span> <span m="306830">that</span> <span m="307030">we're</span> <span m="307180">going</span> <span m="307490">to</span> <span m="308020">translate</span> <span m="308570">a</span> <span m="308690">message</span> <span m="309190">first</span> <span m="309470">of</span> <span m="309540">all</span> <span m="309800">into</span> <span m="309990">a</span> <span m="310090">prime</span> <span m="310390">number,</span> <span m="311520">because</span> <span m="312450">we</span> <span m="312580">want</span> <span m="312760">to</span> <span m="312830">use</span> <span m="313060">numbers.</span> <span m="313430">We're</span> <span m="313660">here</span> <span m="313850">in</span> <span m="314010">number</span> <span m="314210">theory</span> <span m="314560">class,</span> <span m="314930">so</span> <span m="315030">we</span> <span m="315140">want</span> <span m="315310">to</span> <span m="315400">use</span> <span m="315600">some</span> <span m="315880">tricks</span> <span m="316210">with</span> <span m="316400">numbers</span> <span m="316920">in</span> <span m="317070">order</span> <span m="317230">to</span> <span m="317380">encrypt</span> <span m="317830">it.</span> <span m="318810">So</span> <span m="318990">let's</span> <span m="319200">do</span> <span m="319340">this.</span> <span m="324620">So</span> <span m="324800">for example,</span> <span m="326010">let's</span> <span m="326230">take</span> <span m="326530">the</span> <span m="326560">word</span> <span m="327460">victory.</span> <span m="330460">We</span> <span m="330670">can</span> <span m="330830">map</span> <span m="331040">this</span> <span m="331220">into</span> <span m="331920">an</span> <span m="332040">integer.</span> <span m="333270">For</span> <span m="333480">example,</span> <span m="334030">we</span> <span m="334070">could</span> <span m="334230">say,</span> <span m="334900">well,</span> <span m="335960">m</span> <span m="336270">is</span> <span m="337530">22,</span> <span m="338850">where</span> <span m="339040">I</span> <span m="339110">map</span> <span m="339690">V</span> <span m="340340">to--</span> <span m="341730">because</span> <span m="342030">I</span> <span m="342060">know V</span> <span m="342440">is</span> <span m="342610">the</span> <span m="342710">22nd</span> <span m="343470">letter</span> <span m="343740">in</span> <span m="343800">the</span> <span m="343900">alphabet,</span> <span m="344910">I</span> <span m="344980">just</span> <span m="345180">start</span> <span m="345460">with</span> <span m="345550">22.</span> <span m="346600">I</span> <span m="346860">is</span> <span m="347080">the</span> <span m="347140">ninth</span> <span m="347500">letter</span> <span m="347720">in</span> <span m="347820">the</span> <span m="347930">alphabet,</span> <span m="349373">so</span> <span m="349726">I</span> <span m="350080">append</span> <span m="350480">09.</span> <span m="352890">C</span> <span m="353110">is</span> <span m="353330">the</span> <span m="353420">third</span> <span m="353720">letter</span> <span m="353970">in</span> <span m="354030">the</span> <span m="354120">alphabet,</span> <span m="354780">I</span> <span m="355010">append</span> <span m="355490">3--</span> <span m="356290">03.</span> <span m="357470">I</span> <span m="357570">continue</span> <span m="358120">like</span> <span m="358380">this</span> <span m="360420">and</span> <span m="360770">in</span> <span m="361450">end,</span> <span m="362110">over</span> <span m="362440">here</span> <span m="362820">I've</span> <span m="363100">mapped</span> <span m="363350">Y</span> <span m="364380">to</span> <span m="365110">the</span> <span m="365210">25th</span> <span m="365565">letter.</span> <span m="366240">Because</span> <span m="366580">it's the</span> <span m="366800">25th</span> <span m="367250">letter</span> <span m="367480">of</span> <span m="367690">alphabet,</span> <span m="368260">I</span> <span m="368360">write</span> <span m="368620">25.</span> </p>
<p><span m="369820">It</span> <span m="369970">turns</span> <span m="370320">out,</span> <span m="370490">I</span> <span m="370540">can</span> <span m="370740">just</span> <span m="371060">add</span> <span m="371260">a</span> <span m="371330">couple</span> <span m="371740">of</span> <span m="372090">digits</span> <span m="372520">more,</span> <span m="372950">if</span> <span m="373110">I</span> <span m="373180">specially</span> <span m="373740">compute</span> <span m="374070">those.</span> <span m="375030">In</span> <span m="375340">this</span> <span m="375560">case,</span> <span m="376010">I</span> <span m="376330">could add</span> <span m="376580">13,</span> <span m="377960">and</span> <span m="378130">then</span> <span m="378460">it</span> <span m="378630">changes</span> <span m="379190">into</span> <span m="379520">a</span> <span m="379590">prime</span> <span m="379900">number.</span> <span m="383990">Now</span> <span m="384120">we</span> <span m="384240">are not</span> <span m="384330">going</span> <span m="384520">to</span> <span m="384630">talk</span> <span m="384920">about</span> <span m="385280">why</span> <span m="385470">this</span> <span m="385720">is,</span> <span m="386000">and</span> <span m="386260">how</span> <span m="386620">this</span> <span m="386800">can</span> <span m="386960">be</span> <span m="387080">done,</span> <span m="387300">and</span> <span m="387400">so</span> <span m="387590">on.</span> <span m="387810">But</span> <span m="388560">it</span> <span m="388710">turns</span> <span m="388990">out</span> <span m="389130">that</span> <span m="389240">the</span> <span m="389330">prime</span> <span m="389660">numbers</span> <span m="389900">are</span> <span m="390030">densely</span> <span m="391350">distributed</span> <span m="392070">over</span> <span m="392280">the</span> <span m="392400">integers,</span> <span m="393200">and</span> <span m="393450">it's</span> <span m="393600">really</span> <span m="393830">possible</span> <span m="394640">to,</span> <span m="395090">just</span> <span m="395370">with</span> <span m="395510">a</span> <span m="395570">few</span> <span m="395860">extra</span> <span m="396170">digits--</span> <span m="398070">by</span> <span m="398240">selecting</span> <span m="398750">them</span> <span m="399110">in</span> <span m="399240">a</span> <span m="399290">smart</span> <span m="399640">way--</span> <span m="400090">to</span> <span m="400250">actually</span> <span m="400560">create</span> <span m="400850">a</span> <span m="400910">prime</span> <span m="401210">number.</span> <span m="401820">And</span> <span m="402010">also</span> <span m="402620">verify</span> <span m="402960">that</span> <span m="403350">it</span> <span m="403500">is</span> <span m="403690">a</span> <span m="403750">prime</span> <span m="404010">number</span> <span m="404230">very</span> <span m="404490">efficiently.</span> <span m="405100">So</span> <span m="405280">it's</span> <span m="405450">very</span> <span m="406020">easy</span> <span m="406380">to</span> <span m="406500">compute--</span> <span m="407790">to</span> <span m="408280">translate</span> <span m="409050">such</span> <span m="409240">a</span> <span m="409390">word</span> <span m="409880">into</span> <span m="410190">a</span> <span m="410260">prime</span> <span m="410610">number.</span> </p>
<p><span m="411490">So</span> <span m="411540">this</span> <span m="411750">is</span> <span m="411860">how</span> <span m="412040">it</span> <span m="412090">all</span> <span m="412230">starts.</span> <span m="413600">And</span> <span m="414120">just</span> <span m="414370">like</span> <span m="414570">in</span> <span m="414660">an</span> <span m="414780">encryption</span> <span m="415170">scheme,</span> <span m="416950">beforehand</span> <span m="418420">we</span> <span m="418570">are</span> <span m="418650">going</span> <span m="418990">to</span> <span m="420480">exchange</span> <span m="422630">a</span> <span m="423120">key.</span> <span m="424490">So</span> <span m="424720">we</span> <span m="424840">exchange</span> <span m="428060">the</span> <span m="428210">secret</span> <span m="429240">prime</span> <span m="429730">in</span> <span m="429900">this</span> <span m="431270">example,</span> <span m="433730">which</span> <span m="433910">we</span> <span m="434000">call</span> <span m="434300">k.</span> <span m="435790">And</span> <span m="436310">the</span> <span m="436460">encryption</span> <span m="438150">is</span> <span m="438370">very</span> <span m="438630">simple.</span> <span m="440030">We</span> <span m="440110">are</span> <span m="440200">just</span> <span m="440500">going</span> <span m="440690">to</span> <span m="440820">multiply</span> <span m="442450">m</span> <span m="442930">with</span> <span m="443370">k.</span> <span m="444210">Now,</span> <span m="444310">you</span> <span m="444710">may</span> <span m="444930">wonder</span> <span m="445330">why</span> <span m="445470">this is</span> <span m="445820">such</span> <span m="446030">a</span> <span m="446080">fantastic</span> <span m="446610">idea.</span> <span m="447050">But</span> <span m="447670">let's</span> <span m="448830">just</span> <span m="449040">bear</span> <span m="449250">with</span> <span m="449420">me.</span> <span m="449750">So</span> <span m="450380">m</span> <span m="450760">is</span> <span m="450970">this</span> <span m="451510">first</span> <span m="451850">prime</span> <span m="452120">number,</span> <span m="453060">and</span> <span m="453180">we</span> <span m="453260">multiply</span> <span m="453615">it</span> <span m="453970">by a</span> <span m="454130">second</span> <span m="454540">prime</span> <span m="454800">number,</span> <span m="455190">and</span> <span m="455300">that's</span> <span m="455480">going</span> <span m="455630">to</span> <span m="455730">be</span> <span m="455960">our</span> <span m="456520">encryption.</span> </p>
<p><span m="458810">Now</span> <span m="458920">how</span> <span m="459060">do</span> <span m="459150">we</span> <span m="459270">decrypt?</span> <span m="460190">That</span> <span m="460290">seems</span> <span m="460510">to</span> <span m="460580">be</span> <span m="460710">pretty</span> <span m="461050">straightforward,</span> <span m="461700">right?</span> <span m="462090">How</span> <span m="462200">do</span> <span m="462290">we</span> <span m="462390">do</span> <span m="462550">it?</span> <span m="464560">We</span> <span m="464620">start</span> <span m="464950">off</span> <span m="465180">with</span> <span m="465330">m</span> <span m="465550">prime.</span> <span m="467350">I</span> <span m="467490">know</span> <span m="468140">we</span> <span m="468330">have</span> <span m="468480">exchanged</span> <span m="469220">this</span> <span m="469520">secret</span> <span m="469910">prime</span> <span m="470230">k,</span> <span m="470490">so</span> <span m="470690">if</span> <span m="470850">I</span> <span m="471010">receive</span> <span m="472330">from</span> <span m="472580">you</span> <span m="473350">this</span> <span m="473620">message--</span> <span m="474110">this</span> <span m="474270">encrypted</span> <span m="474680">message--</span> <span m="475460">well,</span> <span m="475660">I</span> <span m="475750">know</span> <span m="475930">the</span> <span m="476040">key,</span> <span m="476330">k.</span> <span m="477050">So</span> <span m="477310">I</span> <span m="477420">just</span> <span m="478330">divide</span> <span m="478430">it</span> <span m="478790">by</span> <span m="478960">k.</span> <span m="479820">Well,</span> <span m="481450">which</span> <span m="481590">is</span> <span m="481780">m</span> <span m="482245">k</span> <span m="482710">divided</span> <span m="482860">k,</span> <span m="483240">and</span> <span m="483420">I</span> <span m="483490">get</span> <span m="483790">m.</span> <span m="485030">So</span> <span m="485210">that's</span> <span m="485430">pretty</span> <span m="485660">straightforward.</span> <span m="487730">Now,</span> <span m="488270">as</span> <span m="488420">it</span> <span m="488600">turns</span> <span m="488960">out</span> <span m="489350">actually--</span> <span m="489910">and</span> <span m="490060">I'll</span> <span m="490210">write</span> <span m="490410">it</span> <span m="490550">up</span> <span m="490700">here,</span> <span m="490880">because</span> <span m="491190">we</span> <span m="491270">need it</span> <span m="491510">later--</span> <span m="492690">that</span> <span m="494190">it's</span> <span m="494420">not</span> <span m="494630">so</span> <span m="494840">trivial</span> <span m="495550">to</span> <span m="495830">actually</span> <span m="496900">just</span> <span m="497310">give</span> <span m="497720">an m</span> <span m="498010">prime</span> <span m="498760">to</span> <span m="499240">figure</span> <span m="499580">out</span> <span m="499770">what</span> <span m="500120">m</span> <span m="500230">is,</span> <span m="500640">or</span> <span m="500880">k.</span> <span m="503020">m</span> <span m="503260">prime</span> <span m="503530">is</span> <span m="503670">a</span> <span m="503730">product</span> <span m="504230">of</span> <span m="504360">two</span> <span m="504550">very</span> <span m="504890">large</span> <span m="505230">prime</span> <span m="505540">numbers,</span> <span m="506450">and</span> <span m="507410">that</span> <span m="507600">turns</span> <span m="507870">out</span> <span m="508030">to</span> <span m="508110">be a</span> <span m="508290">really</span> <span m="508510">hard</span> <span m="508730">problem.</span> <span m="509100">Up</span> <span m="509230">to</span> <span m="509350">now,</span> <span m="509530">nobody</span> <span m="509860">has</span> <span m="510000">really</span> <span m="510200">been</span> <span m="510370">able</span> <span m="510640">to</span> <span m="511110">get</span> <span m="511330">a</span> <span m="511400">really</span> <span m="511770">efficient</span> <span m="512220">algorithm</span> <span m="512700">to</span> <span m="512820">solve</span> <span m="513140">that.</span> </p>
<p><span m="514159">So</span> <span m="514340">we</span> <span m="514460">may</span> <span m="514650">think</span> <span m="514890">this</span> <span m="515049">is</span> <span m="515150">secure.</span> <span m="516610">So</span> <span m="516700">let</span> <span m="516799">me</span> <span m="516909">write</span> <span m="517130">it</span> <span m="517230">down</span> <span m="519690">It's</span> <span m="519909">hard</span> <span m="523909">to</span> <span m="524090">factor</span> <span m="525630">a</span> <span m="526830">product</span> <span m="527420">of</span> <span m="527580">two</span> <span m="527780">large</span> <span m="528150">primes.</span> <span m="537850">You will</span> <span m="538040">actually</span> <span m="538610">need</span> <span m="538950">this</span> <span m="539190">also,</span> <span m="539830">when</span> <span m="539960">we</span> <span m="540110">come</span> <span m="540650">to</span> <span m="540770">the</span> <span m="540880">final</span> <span m="541290">encryption</span> <span m="541830">scheme--</span> <span m="542280">RSA</span> <span m="542970">that</span> <span m="543080">we</span> <span m="543240">will</span> <span m="543330">discuss,</span> <span m="543910">which</span> <span m="544090">is</span> <span m="544670">widely</span> <span m="545120">used.</span> <span m="553420">But</span> <span m="553560">something</span> <span m="553940">is</span> <span m="554070">wrong</span> <span m="554340">here,</span> <span m="554610">though.</span> <span m="554740">This</span> <span m="554890">seems</span> <span m="555200">to</span> <span m="555300">be</span> <span m="555460">too</span> <span m="555640">simple,</span> <span m="556060">right?</span> <span m="556510">So</span> <span m="556740">what</span> <span m="556910">can</span> <span m="557070">we</span> <span m="557170">do</span> <span m="557390">if</span> <span m="557560">we</span> <span m="557690">have</span> <span m="558320">like,</span> <span m="558670">say,</span> <span m="559040">suppose</span> <span m="559410">I</span> <span m="559530">intercept</span> <span m="560790">two</span> <span m="561090">encrypted</span> <span m="561580">messages.</span> <span m="562970">What</span> <span m="563110">can</span> <span m="563260">I</span> <span m="563350">do?</span> <span m="571800">So</span> <span m="572020">suppose</span> <span m="572540">I</span> <span m="572650">have</span> <span m="573150">a</span> <span m="573500">first</span> <span m="573850">message,</span> <span m="575520">m</span> <span m="575900">prime</span> <span m="576270">1,</span> <span m="576630">which</span> <span m="576880">is</span> <span m="577030">the</span> <span m="577120">product</span> <span m="577860">of</span> <span m="578310">a</span> <span m="578450">first</span> <span m="579050">plain</span> <span m="579380">message</span> <span m="579920">times</span> <span m="580370">the</span> <span m="580490">key,</span> <span m="580770">k.</span> <span m="581800">And</span> <span m="582040">I</span> <span m="582100">have</span> <span m="582430">a</span> <span m="582460">second</span> <span m="583340">message</span> <span m="583815">that</span> <span m="584290">is</span> <span m="584490">encrypted</span> <span m="585130">by</span> <span m="585250">using</span> <span m="585510">the</span> <span m="585590">same</span> <span m="585910">key,</span> <span m="587010">which</span> <span m="587190">is</span> <span m="587310">m</span> <span m="587570">2</span> <span m="587870">times</span> <span m="588340">k.</span> <span m="589480">Does</span> <span m="589640">anybody</span> <span m="589980">have</span> <span m="590160">an</span> <span m="590260">idea</span> <span m="590510">what</span> <span m="590600">I</span> <span m="590710">could</span> <span m="590890">do</span> <span m="591030">here?</span> </p>
<p><span m="591730">AUDIENCE: Find</span> <span m="592494">the GCD</span> <span m="593462">and</span> <span m="593946">that would</span> <span m="594430">give you the</span> <span m="594914">key.</span> </p>
<p><span m="595400">PROFESSOR: Yeah,</span> <span m="595760">you</span> <span m="595900">could</span> <span m="596410">find</span> <span m="596820">the</span> <span m="597150">GCD</span> <span m="598680">of</span> <span m="599570">m</span> <span m="599850">1</span> <span m="600340">prime</span> <span m="600780">and</span> <span m="602280">m</span> <span m="602340">2</span> <span m="602530">prime.</span> <span m="604000">I've</span> <span m="604190">intercepted</span> <span m="604810">those</span> <span m="605100">two.</span> <span m="605720">Now,</span> <span m="605960">m</span> <span m="606090">1</span> <span m="606470">is</span> <span m="606860">a</span> <span m="606940">prime</span> <span m="607270">number.</span> <span m="608220">k</span> <span m="608540">is</span> <span m="608590">prime</span> <span m="608870">number,</span> <span m="609100">and</span> <span m="609270">2</span> <span m="609390">is</span> <span m="609520">a</span> <span m="609580">prime</span> <span m="609870">number.</span> <span m="610160">k</span> <span m="610500">is a</span> <span m="610550">prime</span> <span m="610900">number</span> <span m="611110">here,</span> <span m="611370">also,</span> <span m="611740">right?</span> <span m="611970">So</span> <span m="612830">they're</span> <span m="613110">all</span> <span m="614540">relatively</span> <span m="615190">prime</span> <span m="615490">towards</span> <span m="616000">one</span> <span m="616150">another.</span> <span m="616690">The</span> <span m="616780">GCD</span> <span m="617860">of</span> <span m="618050">these</span> <span m="618350">two--</span> <span m="619860">well,</span> <span m="620060">the</span> <span m="620310">greatest</span> <span m="620650">common</span> <span m="620850">divisor</span> <span m="621360">is</span> <span m="621630">k.</span> <span m="623080">So</span> <span m="623340">just</span> <span m="623650">by</span> <span m="623760">calculating</span> <span m="624790">the</span> <span m="624880">GCD</span> <span m="625580">of</span> <span m="625750">the</span> <span m="625850">two</span> <span m="626040">encrypted</span> <span m="626770">messages,</span> <span m="627390">I'll</span> <span m="627650">be</span> <span m="627770">able</span> <span m="627960">to</span> <span m="628080">figure</span> <span m="628420">out</span> <span m="628740">what</span> <span m="629360">k</span> <span m="629560">is--</span> <span m="630550">the</span> <span m="630690">key.</span> <span m="633070">Well,</span> <span m="633540">if</span> <span m="633720">I</span> <span m="633780">know</span> <span m="633950">the</span> <span m="634100">key,</span> <span m="634440">then</span> <span m="635440">I</span> <span m="635580">can</span> <span m="635800">do</span> <span m="636390">the</span> <span m="636480">decryption</span> <span m="637030">of</span> <span m="637170">any</span> <span m="637750">cypher</span> <span m="638120">text,</span> <span m="638440">any</span> <span m="638800">encryption</span> <span m="639340">of</span> <span m="639460">a</span> <span m="639520">message</span> <span m="640660">that</span> <span m="640800">I</span> <span m="640850">can</span> <span m="641040">intercept.</span> <span m="642360">So</span> <span m="642400">this</span> <span m="642590">is</span> <span m="642720">not</span> <span m="642940">secure.</span> </p>
<p><span m="644730">So</span> <span m="644960">how</span> <span m="645160">can</span> <span m="645340">we</span> <span m="645950">change</span> <span m="646370">this?</span> <span m="647030">Can</span> <span m="647240">we</span> <span m="648120">create</span> <span m="648600">a</span> <span m="649250">different</span> <span m="649790">kind</span> <span m="650040">of</span> <span m="651290">encryption</span> <span m="651750">scheme?</span> <span m="653870">Let's</span> <span m="654090">do</span> <span m="654200">something</span> <span m="654560">much</span> <span m="654760">more</span> <span m="655220">difficult,</span> <span m="656710">and</span> <span m="657080">then</span> <span m="658370">we</span> <span m="658510">will</span> <span m="659030">get</span> <span m="659310">into</span> <span m="659430">modular</span> <span m="659920">arithmetic</span> <span m="660720">and</span> <span m="661210">things</span> <span m="661550">like</span> <span m="661750">that.</span> <span m="662490">So</span> <span m="662650">let's</span> <span m="662770">do this.</span> <span m="668290">So</span> <span m="668480">Turing's</span> <span m="668870">code,</span> <span m="669460">version</span> <span m="669860">number</span> <span m="670200">two--</span> <span m="671950">we</span> <span m="672100">try</span> <span m="672400">to</span> <span m="673040">do</span> <span m="673140">something</span> <span m="673500">much</span> <span m="673710">more</span> <span m="674400">complicated</span> <span m="675040">than</span> <span m="675170">just</span> <span m="675420">multiplying</span> <span m="675970">by</span> <span m="676160">prime.</span> <span m="677050">So</span> <span m="677240">let's</span> <span m="677460">do</span> <span m="677550">the</span> <span m="677620">following.</span> <span m="679230">So</span> <span m="679460">beforehand,</span> <span m="681660">we're</span> <span m="681840">going</span> <span m="682040">to</span> <span m="682150">exchange</span> <span m="686610">not</span> <span m="686890">only</span> <span m="687270">a</span> <span m="687340">secret</span> <span m="687770">prime</span> <span m="688120">k,</span> <span m="689040">but</span> <span m="689170">we will</span> <span m="689420">also</span> <span m="689930">exchange</span> <span m="691600">a</span> <span m="691730">public</span> <span m="692210">prime.</span> <span m="693890">So</span> <span m="694030">we</span> <span m="694150">exchange--</span> <span m="697070">by</span> <span m="697210">public</span> <span m="697500">we</span> <span m="697790">mean</span> <span m="698230">that</span> <span m="698480">anybody</span> <span m="699430">can</span> <span m="699590">see</span> <span m="699840">this</span> <span m="699970">prime.</span> <span m="700630">It's</span> <span m="701240">common</span> <span m="701530">knowledge.</span> <span m="702790">A</span> <span m="702920">public</span> <span m="703350">prime</span> <span m="705280">p,</span> <span m="706870">and</span> <span m="707150">also</span> <span m="708370">a</span> <span m="708470">secret</span> <span m="711440">prime</span> <span m="713500">k.</span> <span m="714240">Let's</span> <span m="714520">see</span> <span m="714690">whether</span> <span m="714810">this</span> <span m="714970">would</span> <span m="715640">work.</span> </p>
<p><span m="717780">We</span> <span m="717930">have</span> <span m="718280">encryption.</span> <span m="721490">Well,</span> <span m="721850">we're</span> <span m="722230">going</span> <span m="722430">to</span> <span m="722540">start</span> <span m="722960">out</span> <span m="723370">exactly</span> <span m="723880">the</span> <span m="723990">same</span> <span m="724320">way.</span> <span m="727870">First</span> <span m="728140">of</span> <span m="728250">all,</span> <span m="728470">I</span> <span m="728570">should</span> <span m="728650">tell</span> <span m="728900">you</span> <span m="729060">how</span> <span m="729250">a</span> <span m="729310">message</span> <span m="729710">is</span> <span m="729800">represented.</span> <span m="731450">The</span> <span m="731510">message</span> <span m="731880">is</span> <span m="732090">going to</span> <span m="732300">be</span> <span m="732430">represented</span> <span m="733140">as</span> <span m="733310">a</span> <span m="733370">number,</span> <span m="738400">m,</span> <span m="739360">in</span> <span m="739530">the</span> <span m="739640">range</span> <span m="740040">from</span> <span m="740280">0,</span> <span m="740930">1,</span> <span m="741890">all</span> <span m="742130">the</span> <span m="742220">way</span> <span m="742400">to</span> <span m="742570">p</span> <span m="742850">minus</span> <span m="743250">1.</span> <span m="745270">And</span> <span m="747220">we</span> <span m="747350">will</span> <span m="747500">compute</span> <span m="748580">the</span> <span m="748720">encryption</span> <span m="749250">as</span> <span m="749400">follows.</span> <span m="751988">m</span> <span m="753420">is</span> <span m="753590">going</span> <span m="753860">to</span> <span m="754030">be</span> <span m="754390">the</span> <span m="754480">remainder</span> <span m="756450">of</span> <span m="757550">m</span> <span m="757840">times</span> <span m="758240">k,</span> <span m="758970">after</span> <span m="759280">dividing</span> <span m="759820">out</span> <span m="759970">as</span> <span m="760120">many</span> <span m="760350">multiples</span> <span m="760950">of</span> <span m="761110">p</span> <span m="761320">as</span> <span m="761490">possible.</span> <span m="762930">So</span> <span m="763330">notice</span> <span m="763750">we</span> <span m="763900">do</span> <span m="764525">kind</span> <span m="764820">of</span> <span m="764940">the</span> <span m="765030">same</span> <span m="765300">thing.</span> <span m="765560">We</span> <span m="765660">just</span> <span m="765910">multiply</span> <span m="766330">by</span> <span m="766510">k,</span> <span m="767420">but</span> <span m="767580">now</span> <span m="767740">we</span> <span m="767830">just</span> <span m="769450">take</span> <span m="769610">the</span> <span m="769680">remainder</span> <span m="770790">after</span> <span m="771280">taking</span> <span m="771610">out</span> <span m="771730">as</span> <span m="771860">many</span> <span m="772080">multiples</span> <span m="772580">of</span> <span m="772720">p.</span> </p>
<p><span m="775080">Well,</span> <span m="775530">let's</span> <span m="775720">see</span> <span m="775840">whether</span> <span m="775990">we</span> <span m="776110">can</span> <span m="776240">do</span> <span m="776330">the</span> <span m="776430">decryption.</span> <span m="778650">It</span> <span m="778770">seems</span> <span m="779000">to</span> <span m="779090">be,</span> <span m="780130">like,</span> <span m="780350">a</span> <span m="780410">next</span> <span m="780750">level</span> <span m="781050">of</span> <span m="781180">complexity.</span> <span m="781950">So</span> <span m="781990">maybe</span> <span m="782240">that'll</span> <span m="782490">help</span> <span m="782790">us</span> <span m="782920">here,</span> <span m="783140">right?</span> <span m="784900">So</span> <span m="785080">how</span> <span m="785340">will we</span> <span m="785480">do</span> <span m="785740">decryption?</span> <span m="786750">Well,</span> <span m="787150">somehow</span> <span m="787720">we</span> <span m="787830">would</span> <span m="787990">like</span> <span m="788170">to</span> <span m="788280">divide</span> <span m="788670">by</span> <span m="788950">k.</span> <span m="789630">But</span> <span m="789780">we</span> <span m="789880">cannot</span> <span m="790150">really</span> <span m="790360">do</span> <span m="790520">that,</span> <span m="790700">right?</span> <span m="791940">This</span> <span m="792430">does</span> <span m="792720">not</span> <span m="792890">make</span> <span m="793100">any</span> <span m="793280">sense.</span> <span m="795570">So</span> <span m="795640">the</span> <span m="795740">decryption--</span> <span m="796240">we</span> <span m="796650">have</span> <span m="796860">no</span> <span m="797080">idea</span> <span m="797350">at</span> <span m="797410">this</span> <span m="797640">point</span> <span m="797990">how</span> <span m="798170">to</span> <span m="798250">do</span> <span m="798430">this.</span> <span m="799410">And</span> <span m="801100">now</span> <span m="801240">we</span> <span m="801350">can</span> <span m="801530">get</span> <span m="801800">into</span> <span m="801950">modular</span> <span m="802460">arithmetic,</span> <span m="803070">because</span> <span m="803480">it</span> <span m="803590">turns</span> <span m="803950">out</span> <span m="804270">that</span> <span m="804370">we can</span> <span m="804790">sort</span> <span m="805120">of</span> <span m="805240">divide by</span> <span m="805340">k.</span> <span m="806220">There</span> <span m="806450">exists</span> <span m="807630">what we call</span> <span m="808140">multiplicative</span> <span m="809050">inverse</span> <span m="809790">of</span> <span m="810100">k</span> <span m="810890">modulo</span> <span m="811360">p.</span> <span m="811720">And I will</span> <span m="811910">explain</span> <span m="812350">all</span> <span m="812540">those</span> <span m="813010">terminologies</span> <span m="813640">to</span> <span m="814100">you.</span> <span m="814580">And</span> <span m="816100">then</span> <span m="816500">we</span> <span m="816610">will</span> <span m="816800">be</span> <span m="816960">able</span> <span m="817590">to</span> <span m="817740">take</span> <span m="818010">m</span> <span m="818250">prime,</span> <span m="819260">and</span> <span m="819940">transform</span> <span m="820420">it</span> <span m="820520">back</span> <span m="820870">to</span> <span m="821060">m.</span> <span m="822320">So</span> <span m="822590">we</span> <span m="822700">will</span> <span m="822850">be</span> <span m="823020">able</span> <span m="823190">to</span> <span m="823770">get</span> <span m="823950">a</span> <span m="824020">lot</span> <span m="824180">of</span> <span m="824310">this</span> <span m="824520">machinery</span> <span m="827370">going.</span> </p>
<p><span m="828160">So</span> <span m="828460">let's</span> <span m="830290">find</span> <span m="830760">out</span> <span m="830940">how</span> <span m="831070">this</span> <span m="831230">works.</span> <span m="832250">So</span> <span m="832650">first</span> <span m="832920">of</span> <span m="833020">all,</span> <span m="833770">last</span> <span m="834140">time</span> <span m="834340">we</span> <span m="834460">saw</span> <span m="834830">that</span> <span m="837010">we</span> <span m="837100">defined</span> <span m="837740">a</span> <span m="838005">and</span> <span m="838270">b</span> <span m="838510">to</span> <span m="838640">be</span> <span m="838870">relatively</span> <span m="839460">prime.</span> <span m="839870">So</span> <span m="840610">let</span> <span m="840770">me</span> <span m="840880">repeat</span> <span m="841330">that.</span> <span m="843030">So</span> <span m="843340">a</span> <span m="843690">and b are</span> <span m="843750">relatively</span> <span m="844290">prime</span> <span m="846630">if</span> <span m="846870">and</span> <span m="847010">only</span> <span m="847400">if--</span> <span m="848730">that's</span> <span m="848910">how</span> <span m="849040">we</span> <span m="849130">define</span> <span m="849620">it--</span> <span m="850220">if</span> <span m="850450">the</span> <span m="850600">GCD</span> <span m="851600">of</span> <span m="852050">a and</span> <span m="852550">b</span> <span m="853190">is</span> <span m="853350">equal</span> <span m="853640">to 1.</span> <span m="853810">And</span> <span m="855840">in</span> <span m="856070">last</span> <span m="856360">lecture</span> <span m="856850">and</span> <span m="857310">in</span> <span m="857430">the</span> <span m="857520">recitation,</span> <span m="857610">you</span> <span m="858080">got</span> <span m="858330">a</span> <span m="858520">different</span> <span m="858700">proof,</span> <span m="859170">I</span> <span m="859230">think.</span> <span m="859860">And</span> <span m="860550">we</span> <span m="860710">proved</span> <span m="861240">that,</span> <span m="862000">actually,</span> <span m="863750">the</span> <span m="863940">GCD</span> <span m="864430">of</span> <span m="864550">a and b</span> <span m="865300">is</span> <span m="865440">equal</span> <span m="865660">to</span> <span m="865760">the</span> <span m="865870">smallest</span> <span m="866660">positive</span> <span m="867380">linear</span> <span m="867750">combination</span> <span m="868560">of a</span> <span m="868600">and</span> <span m="869430">b.</span> <span m="870780">So</span> <span m="870940">that</span> <span m="871070">means</span> <span m="871240">that</span> <span m="871550">one,</span> <span m="871890">in</span> <span m="871960">particular,</span> <span m="872880">is</span> <span m="873120">a</span> <span m="873260">linear</span> <span m="873580">combination</span> <span m="874150">of</span> <span m="874290">a and b.</span> <span m="874500">So</span> <span m="875630">there</span> <span m="875840">exists</span> <span m="876890">integers--</span> <span m="877730">s</span> <span m="877940">and</span> <span m="878130">t--</span> <span m="879010">such</span> <span m="879340">that</span> <span m="879890">s</span> <span m="880180">times</span> <span m="880600">a,</span> <span m="880935">plus</span> <span m="881270">t</span> <span m="881470">times</span> <span m="881900">b</span> <span m="882390">equals</span> <span m="882780">1.</span> <span m="884170">It</span> <span m="884310">turns</span> <span m="884590">out</span> <span m="884730">that</span> <span m="884820">it</span> <span m="884910">can</span> <span m="885050">also</span> <span m="885240">go</span> <span m="885410">the</span> <span m="885530">other</span> <span m="885670">way</span> <span m="885830">around,</span> <span m="886290">because</span> <span m="888250">if</span> <span m="888480">I</span> <span m="888570">can</span> <span m="888770">write</span> <span m="889090">one</span> <span m="889410">as</span> <span m="889600">a</span> <span m="889640">linear</span> <span m="889980">combination</span> <span m="890630">of</span> <span m="890770">a</span> <span m="891020">b,</span> <span m="891930">well</span> <span m="892130">I</span> <span m="892250">cannot</span> <span m="892710">get</span> <span m="892880">much</span> <span m="893090">lower</span> <span m="893340">than</span> <span m="893510">that,</span> <span m="893670">right?</span> <span m="894060">So</span> <span m="894360">that's</span> <span m="894670">really</span> <span m="894970">the</span> <span m="895060">smallest</span> <span m="895550">possible</span> <span m="895950">that</span> <span m="896070">I</span> <span m="896170">can</span> <span m="896350">achieve.</span> <span m="896730">So</span> <span m="897200">the</span> <span m="897280">GCD</span> <span m="897870">must</span> <span m="898160">be</span> <span m="898350">equal</span> <span m="898540">to</span> <span m="898690">1.</span> <span m="900080">So</span> <span m="900260">this</span> <span m="900480">is</span> <span m="900600">a</span> <span m="900670">property</span> <span m="901110">that</span> <span m="901300">we will</span> <span m="901490">be using.</span> </p>
<p><span m="906130">And</span> <span m="907340">from</span> <span m="907560">this</span> <span m="907760">property,</span> <span m="908340">we</span> <span m="908350">can</span> <span m="908550">already</span> <span m="908930">figure</span> <span m="909290">out</span> <span m="909910">an</span> <span m="910010">interesting</span> <span m="910420">property.</span> <span m="910940">So</span> <span m="911400">suppose</span> <span m="911850">we</span> <span m="911940">have</span> <span m="912480">a</span> <span m="912540">linear</span> <span m="912830">combination</span> <span m="913400">that</span> <span m="913500">looks</span> <span m="913710">like</span> <span m="913920">this.</span> <span m="915100">Then</span> <span m="915150">you</span> <span m="915270">can</span> <span m="915440">imagine</span> <span m="916060">that,</span> <span m="917340">sort</span> <span m="917620">of,</span> <span m="917720">that</span> <span m="918050">s</span> <span m="918350">times</span> <span m="918760">a</span> <span m="919360">is</span> <span m="919580">equal</span> <span m="919940">to</span> <span m="920110">1,</span> <span m="921460">plus</span> <span m="921750">or</span> <span m="921820">minus</span> <span m="922260">some</span> <span m="922520">linear</span> <span m="923540">multiple</span> <span m="924540">of</span> <span m="924890">b.</span> <span m="926300">So</span> <span m="927610">it's</span> <span m="927820">sort</span> <span m="928070">of--</span> <span m="928310">s</span> <span m="928540">times</span> <span m="928820">a</span> <span m="929020">is</span> <span m="929210">sort of</span> <span m="929300">equal</span> <span m="929640">to</span> <span m="929830">1,</span> <span m="930200">you</span> <span m="930570">can</span> <span m="930770">say,</span> <span m="931310">up</span> <span m="931510">to</span> <span m="931640">a</span> <span m="931700">multiple</span> <span m="932150">of</span> <span m="932330">b.</span> <span m="933480">So</span> <span m="934820">you</span> <span m="934970">can</span> <span m="935160">see</span> <span m="935700">a</span> <span m="936180">sort</span> <span m="936430">of</span> <span m="936510">as an</span> <span m="936890">inverse</span> <span m="937590">of</span> <span m="937880">s.</span> <span m="939000">Because</span> <span m="939460">s</span> <span m="939670">times</span> <span m="940010">a</span> <span m="940450">is</span> <span m="940650">equal</span> <span m="940850">to</span> <span m="940970">one,</span> <span m="941265">sort</span> <span m="941560">of.</span> </p>
<p><span m="942380">So</span> <span m="942560">this</span> <span m="942750">is</span> <span m="942850">what</span> <span m="942970">we're</span> <span m="943110">going</span> <span m="943340">to</span> <span m="943450">use--</span> <span m="943710">this</span> <span m="943900">kind</span> <span m="944130">of</span> <span m="944620">feeling.</span> <span m="945660">And</span> <span m="947020">in</span> <span m="947120">order to</span> <span m="947390">do</span> <span m="947650">that,</span> <span m="947930">we</span> <span m="948060">are</span> <span m="948120">going</span> <span m="948440">to</span> <span m="949110">define</span> <span m="950340">congruency.</span> <span m="955230">So</span> <span m="955420">that's</span> <span m="955680">the</span> <span m="955760">first</span> <span m="956060">definition</span> <span m="956660">for</span> <span m="956820">this</span> <span m="957010">lecture.</span> <span m="958300">We</span> <span m="958390">say</span> <span m="958740">x</span> <span m="959150">is</span> <span m="960480">congruent</span> <span m="964290">to</span> <span m="964460">y</span> <span m="966130">modulo</span> <span m="968720">n,</span> <span m="970940">if--</span> <span m="973130">which</span> <span m="973340">we</span> <span m="973450">denote</span> <span m="973660">as</span> <span m="974040">follows--</span> <span m="974610">x</span> <span m="975110">with</span> <span m="975960">three</span> <span m="976290">bars,</span> <span m="978160">y</span> <span m="978590">in</span> <span m="978720">between</span> <span m="979020">brackets,</span> <span m="979640">mod</span> <span m="981128">n.</span> <span m="982460">And</span> <span m="983550">we</span> <span m="983750">say that</span> <span m="984000">this</span> <span m="984510">is</span> <span m="984730">the</span> <span m="984880">case</span> <span m="986100">if</span> <span m="990310">n</span> <span m="990710">divides</span> <span m="991330">the</span> <span m="991390">difference</span> <span m="991970">between</span> <span m="992370">x</span> <span m="992830">and</span> <span m="993050">y.</span> <span m="994150">So</span> <span m="994340">let's</span> <span m="995720">have</span> <span m="995880">a</span> <span m="995950">look</span> <span m="996140">at</span> <span m="996230">some</span> <span m="996410">examples.</span> </p>
<p><span m="1004580">So</span> <span m="1004760">let's</span> <span m="1005930">take</span> <span m="1006350">31,</span> <span m="1008250">and</span> <span m="1008740">I would</span> <span m="1008760">like</span> <span m="1009130">to</span> <span m="1009230">show</span> <span m="1009510">to</span> <span m="1009760">you that</span> <span m="1009870">this</span> <span m="1010130">is</span> <span m="1010350">congruent</span> <span m="1011000">to</span> <span m="1011120">16</span> <span m="1013250">modulo,</span> <span m="1014710">between</span> <span m="1014910">brackets,</span> <span m="1016110">5.</span> <span m="1017570">Why</span> <span m="1017750">is</span> <span m="1017870">this?</span> <span m="1018550">Well,</span> <span m="1019090">I</span> <span m="1019200">take</span> <span m="1019390">the</span> <span m="1019460">difference</span> <span m="1019860">between</span> <span m="1020130">31</span> <span m="1020513">and</span> <span m="1020896">16,</span> <span m="1021280">which</span> <span m="1021480">is</span> <span m="1021580">15,</span> <span m="1022910">and</span> <span m="1023120">I</span> <span m="1023140">know</span> <span m="1023380">that</span> <span m="1023990">15</span> <span m="1024410">is</span> <span m="1024579">3</span> <span m="1024800">times</span> <span m="1025180">5,</span> <span m="1025520">so</span> <span m="1025990">5</span> <span m="1026530">divides</span> <span m="1027579">this</span> <span m="1027800">difference.</span> <span m="1028700">And</span> <span m="1028829">then</span> <span m="1028930">by</span> <span m="1029079">definition,</span> <span m="1030640">we</span> <span m="1030740">can</span> <span m="1030910">write</span> <span m="1031150">it</span> <span m="1031270">like</span> <span m="1031480">this.</span> <span m="1032210">And</span> <span m="1032390">we</span> <span m="1032510">say--</span> <span m="1033490">that's</span> <span m="1033690">the</span> <span m="1033760">definition--</span> <span m="1034390">31</span> <span m="1034970">is</span> <span m="1035190">congruent</span> <span m="1035630">to</span> <span m="1035730">16</span> <span m="1036319">modulo</span> <span m="1036780">5.</span> <span m="1037730">Another</span> <span m="1038050">example</span> <span m="1038670">is--</span> <span m="1041920">no,</span> <span m="1042050">we</span> <span m="1042240">will</span> <span m="1042430">stick</span> <span m="1042690">with</span> <span m="1042800">this</span> <span m="1042960">example.</span> <span m="1044290">It's</span> <span m="1044440">pretty</span> <span m="1044680">clear.</span> <span m="1046569">So</span> <span m="1046790">once</span> <span m="1047010">we</span> <span m="1047109">have</span> <span m="1047310">defined</span> <span m="1047730">this,</span> <span m="1048670">we</span> <span m="1048900">can</span> <span m="1049070">continue</span> <span m="1050060">and</span> <span m="1051630">talk</span> <span m="1051920">about</span> <span m="1052300">this</span> <span m="1052460">inverse</span> <span m="1053230">that</span> <span m="1053420">I</span> <span m="1053450">was</span> <span m="1053610">talking</span> <span m="1053970">about.</span> <span m="1054310">So</span> <span m="1054940">we</span> <span m="1055110">like</span> <span m="1055310">to,</span> <span m="1055440">sort</span> <span m="1055770">of,</span> <span m="1055900">explain</span> <span m="1057160">in this</span> <span m="1057580">encryption</span> <span m="1058050">scheme</span> <span m="1059020">how</span> <span m="1059660">we</span> <span m="1059940">can</span> <span m="1060150">divide</span> <span m="1060930">by</span> <span m="1061460">k.</span> <span m="1062540">Actually,</span> <span m="1062820">we would</span> <span m="1063000">like</span> <span m="1063170">to</span> <span m="1063280">multiply</span> <span m="1063800">by</span> <span m="1064100">an</span> <span m="1064280">inverse</span> <span m="1064960">of</span> <span m="1065220">k.</span> <span m="1066310">And</span> <span m="1066970">we're</span> <span m="1067110">going</span> <span m="1067300">to</span> <span m="1067420">use</span> <span m="1067700">this</span> <span m="1068920">framework.</span> </p>
<p><span m="1070420">So</span> <span m="1070740">we'll have</span> <span m="1070910">a</span> <span m="1070960">new</span> <span m="1071150">definition</span> <span m="1074000">that</span> <span m="1074140">talks</span> <span m="1074400">about</span> <span m="1074680">the</span> <span m="1074760">multiplicative</span> <span m="1075510">inverse.</span> <span m="1076950">So</span> <span m="1077060">it's</span> <span m="1077190">a</span> <span m="1077250">new</span> <span m="1077460">concept.</span> <span m="1079180">And</span> <span m="1079510">you'll</span> <span m="1079660">give a</span> <span m="1079940">couple</span> <span m="1080170">of</span> <span m="1080290">examples.</span> <span m="1081780">So</span> <span m="1082080">the</span> <span m="1082160">multiplicative</span> <span m="1086800">inverse</span> <span m="1090030">of</span> <span m="1090340">x</span> <span m="1092730">modulo</span> <span m="1093490">n</span> <span m="1095350">is</span> <span m="1096460">a</span> <span m="1096700">number,</span> <span m="1097780">which</span> <span m="1098040">we</span> <span m="1098150">denote</span> <span m="1102150">by</span> <span m="1102520">x</span> <span m="1103110">and</span> <span m="1103330">then</span> <span m="1103510">minus</span> <span m="1103940">1</span> <span m="1104240">on</span> <span m="1104450">top</span> <span m="1104650">of</span> <span m="1104740">here.</span> <span m="1107290">It's</span> <span m="1107490">a</span> <span m="1107540">number</span> <span m="1107940">in</span> <span m="1108100">the</span> <span m="1108560">interval</span> <span m="1108900">0,</span> <span m="1109680">1,</span> <span m="1111280">all</span> <span m="1111480">the</span> <span m="1111550">way</span> <span m="1111830">up</span> <span m="1111980">to</span> <span m="1112150">n</span> <span m="1112370">minus</span> <span m="1112770">1.</span> <span m="1114960">Such</span> <span m="1115390">that</span> <span m="1118050">x</span> <span m="1118590">times</span> <span m="1119310">x</span> <span m="1120000">inverse--</span> <span m="1120990">so</span> <span m="1121490">x</span> <span m="1121800">times</span> <span m="1122150">its</span> <span m="1122310">multiplicative</span> <span m="1123160">inverse--</span> <span m="1124190">is</span> <span m="1124490">congruent</span> <span m="1125130">to</span> <span m="1125310">1</span> <span m="1126010">modulo</span> <span m="1128300">n.</span> <span m="1129440">So</span> <span m="1129620">this</span> <span m="1129840">is</span> <span m="1129970">the</span> <span m="1130070">definition</span> <span m="1130710">for</span> <span m="1130930">a</span> <span m="1130960">multiplicative</span> <span m="1131710">inverse.</span> </p>
<p><span m="1132810">So</span> <span m="1132990">let's</span> <span m="1133070">have</span> <span m="1134480">some</span> <span m="1134730">examples.</span> <span m="1140440">So</span> <span m="1140740">let's do</span> <span m="1140960">that over</span> <span m="1141100">here.</span> <span m="1142890">For</span> <span m="1143050">example,</span> <span m="1144880">we</span> <span m="1145060">have</span> <span m="1145710">that</span> <span m="1146880">2</span> <span m="1147120">times</span> <span m="1147700">3--</span> <span m="1148430">which</span> <span m="1148610">equals</span> <span m="1148900">6--</span> <span m="1150690">is</span> <span m="1151570">equal</span> <span m="1151980">to 1</span> <span m="1153814">modulo</span> <span m="1154220">5.</span> <span m="1155900">Why</span> <span m="1156090">is</span> <span m="1156250">this?</span> <span m="1156680">Well,</span> <span m="1157630">6</span> <span m="1157970">minus</span> <span m="1158420">1</span> <span m="1158890">is</span> <span m="1159140">divisible</span> <span m="1159630">by</span> <span m="1159810">5,</span> <span m="1160310">so</span> <span m="1160520">I</span> <span m="1160610">know</span> <span m="1161420">is</span> <span m="1161580">congruent</span> <span m="1162110">to</span> <span m="1162260">1</span> <span m="1163500">modulo</span> <span m="1163650">5.</span> <span m="1164720">So</span> <span m="1164920">what</span> <span m="1165020">does</span> <span m="1165180">this</span> <span m="1165350">mean?</span> <span m="1167130">Well,</span> <span m="1167340">we</span> <span m="1167470">can</span> <span m="1167640">say</span> <span m="1167890">that</span> <span m="1168180">two</span> <span m="1168580">is</span> <span m="1168780">actually</span> <span m="1169160">equal</span> <span m="1169470">to</span> <span m="1169600">the</span> <span m="1169730">multiplicative</span> <span m="1170590">inverse</span> <span m="1171470">of</span> <span m="1171600">3</span> <span m="1174620">modulo</span> <span m="1175130">5.</span> <span m="1176460">We</span> <span m="1176630">can</span> <span m="1176810">also</span> <span m="1177070">say</span> <span m="1177550">that</span> <span m="1178410">write</span> <span m="1178910">3</span> <span m="1179500">is</span> <span m="1179830">the</span> <span m="1180600">multiplicative</span> <span m="1181420">inverse</span> <span m="1182060">of</span> <span m="1182240">2</span> <span m="1182920">modulo</span> <span m="1183330">5.</span> <span m="1185450">Let's</span> <span m="1185630">have</span> <span m="1185760">another</span> <span m="1186040">example,</span> <span m="1187520">just</span> <span m="1187770">to</span> <span m="1187840">make</span> <span m="1188120">it</span> <span m="1188240">a</span> <span m="1188280">little</span> <span m="1188440">bit</span> <span m="1188580">more</span> <span m="1188800">clear.</span> <span m="1191150">We</span> <span m="1191290">know</span> <span m="1191470">that</span> <span m="1191720">5</span> <span m="1192030">times</span> <span m="1192340">5</span> <span m="1192600">equals</span> <span m="1192920">25,</span> <span m="1194370">and</span> <span m="1194550">this</span> <span m="1194700">is</span> <span m="1194840">congruent</span> <span m="1195280">to</span> <span m="1195420">1</span> <span m="1195920">modulo</span> <span m="1197370">6,</span> <span m="1198530">because</span> <span m="1199610">25</span> <span m="1200210">is</span> <span m="1200350">1</span> <span m="1200570">plus</span> <span m="1200840">4</span> <span m="1201050">times</span> <span m="1201300">6.</span> <span m="1203150">So</span> <span m="1203320">now</span> <span m="1203510">we</span> <span m="1203620">see</span> <span m="1203780">something</span> <span m="1204120">funny</span> <span m="1204420">happening,</span> <span m="1205040">because</span> <span m="1206200">5</span> <span m="1207120">is</span> <span m="1207300">actually</span> <span m="1207640">equal</span> <span m="1207880">to</span> <span m="1208040">its</span> <span m="1208330">own</span> <span m="1208730">multiplicative</span> <span m="1209580">inverse</span> <span m="1211030">modulo</span> <span m="1211450">6.</span> <span m="1218470">So</span> <span m="1219370">are</span> <span m="1219490">there</span> <span m="1219600">any</span> <span m="1219800">questions</span> <span m="1220250">about</span> <span m="1220550">these</span> <span m="1220740">concepts?</span> <span m="1221310">Because</span> <span m="1221640">these</span> <span m="1222060">are</span> <span m="1222420">really</span> <span m="1222700">basic</span> <span m="1223380">for</span> <span m="1223850">the</span> <span m="1223930">whole</span> <span m="1224180">lecture,</span> <span m="1224630">and</span> <span m="1224770">this</span> <span m="1224940">is</span> <span m="1225550">what</span> <span m="1225780">you</span> <span m="1225920">really</span> <span m="1226120">need</span> <span m="1226270">to</span> <span m="1226350">understand</span> <span m="1226800">if</span> <span m="1226890">you</span> <span m="1226980">do all the</span> <span m="1227260">problem</span> <span m="1227650">sets</span> <span m="1227930">as</span> <span m="1228050">well.</span> <span m="1229990">Are there</span> <span m="1230160">any</span> <span m="1230320">questions?</span> </p>
<p><span m="1232160">So</span> <span m="1234570">now</span> <span m="1234740">we</span> <span m="1234850">can</span> <span m="1235120">actually</span> <span m="1235720">start</span> <span m="1236540">talking</span> <span m="1236910">about</span> <span m="1237290">this</span> <span m="1238930">second</span> <span m="1239280">version</span> <span m="1239760">of</span> <span m="1239860">the</span> <span m="1239960">Turing</span> <span m="1240300">code</span> <span m="1240750">that</span> <span m="1240840">we</span> <span m="1242460">invented.</span> <span m="1244670">Let's</span> <span m="1244850">have a</span> <span m="1245130">look</span> <span m="1245320">at</span> <span m="1245390">this</span> <span m="1245590">remainder.</span> <span m="1246450">So</span> <span m="1246540">let's</span> <span m="1246730">write</span> <span m="1246930">it</span> <span m="1247040">out</span> <span m="1247240">again.</span> <span m="1248430">The</span> <span m="1248520">remainder</span> <span m="1249170">of</span> <span m="1250430">m</span> <span m="1250790">times</span> <span m="1251370">k,</span> <span m="1252880">after</span> <span m="1253160">dividing</span> <span m="1253630">out</span> <span m="1253750">as</span> <span m="1253890">many</span> <span m="1254160">multiples</span> <span m="1254690">of</span> <span m="1254920">p.</span> <span m="1256230">Well,</span> <span m="1256890">we</span> <span m="1257030">know</span> <span m="1257260">that</span> <span m="1257420">this</span> <span m="1257640">is</span> <span m="1257900">congruent</span> <span m="1258740">to</span> <span m="1260020">m</span> <span m="1260340">times</span> <span m="1260840">k</span> <span m="1261510">modulo</span> <span m="1262030">p.</span> <span m="1263990">So</span> <span m="1264210">why</span> <span m="1264430">is</span> <span m="1264630">this?</span> <span m="1266020">Well,</span> <span m="1266220">we</span> <span m="1266320">just</span> <span m="1266680">apply</span> <span m="1266970">the</span> <span m="1267070">definition</span> <span m="1267640">over</span> <span m="1267900">here.</span> <span m="1268620">We</span> <span m="1268740">take</span> <span m="1268930">the</span> <span m="1269000">difference</span> <span m="1269440">between</span> <span m="1269790">those</span> <span m="1270080">two.</span> <span m="1270270">So</span> <span m="1270500">here</span> <span m="1270740">we</span> <span m="1270870">have</span> <span m="1271900">the</span> <span m="1272050">remainder</span> <span m="1273400">of</span> <span m="1273730">m</span> <span m="1273950">times</span> <span m="1274320">k,</span> <span m="1274810">after</span> <span m="1275080">dividing</span> <span m="1275560">out</span> <span m="1275690">as</span> <span m="1275830">many</span> <span m="1276020">multiples</span> <span m="1276480">of</span> <span m="1276620">p.</span> <span m="1278930">And</span> <span m="1279890">if</span> <span m="1280060">you</span> <span m="1280140">subtract</span> <span m="1280660">that</span> <span m="1280830">from</span> <span m="1281030">m</span> <span m="1281200">times</span> <span m="1281420">k,</span> <span m="1282470">well</span> <span m="1282650">then</span> <span m="1283790">we</span> <span m="1284020">have</span> <span m="1284320">something</span> <span m="1284870">that</span> <span m="1285050">is a</span> <span m="1285220">multiple</span> <span m="1285960">of</span> <span m="1286170">p,</span> <span m="1286350">because</span> <span m="1286860">that's</span> <span m="1287060">what</span> <span m="1287270">we</span> <span m="1287340">divided</span> <span m="1287810">out.</span> </p>
<p><span m="1288560">So</span> <span m="1288970">the</span> <span m="1289080">difference</span> <span m="1289640">is</span> <span m="1289810">a</span> <span m="1289870">multiple</span> <span m="1290390">of</span> <span m="1290510">p,</span> <span m="1292570">so</span> <span m="1292810">that</span> <span m="1293020">means</span> <span m="1293240">that</span> <span m="1293360">p</span> <span m="1293560">divides</span> <span m="1294040">the</span> <span m="1294110">difference.</span> <span m="1294810">And</span> <span m="1294840">that's</span> <span m="1295000">the</span> <span m="1295070">definition</span> <span m="1295860">of</span> <span m="1295970">saying</span> <span m="1296900">that</span> <span m="1297100">this</span> <span m="1297300">remainder</span> <span m="1297790">is</span> <span m="1297950">congruent</span> <span m="1298450">m</span> <span m="1298770">k</span> <span m="1299090">modulo</span> <span m="1299375">p.</span> <span m="1300540">So</span> <span m="1300670">this</span> <span m="1300880">is</span> <span m="1301050">kind</span> <span m="1301280">of</span> <span m="1301380">interesting,</span> <span m="1301990">because</span> <span m="1302370">now</span> <span m="1303530">we</span> <span m="1304750">can</span> <span m="1304970">rewrite</span> <span m="1305990">over</span> <span m="1306270">there--</span> <span m="1307610">well,</span> <span m="1307780">not</span> <span m="1307940">really</span> <span m="1308140">rewrite,</span> <span m="1308570">but</span> <span m="1308670">we</span> <span m="1308840">can</span> <span m="1309540">use</span> <span m="1309980">this</span> <span m="1310560">to</span> <span m="1310740">analyze</span> <span m="1311730">the</span> <span m="1311910">encryption</span> <span m="1312410">over</span> <span m="1312660">here.</span> <span m="1313240">So</span> <span m="1313540">m</span> <span m="1313740">prime</span> <span m="1315620">is</span> <span m="1315820">equal</span> <span m="1316180">to</span> <span m="1316340">this</span> <span m="1317240">remainder.</span> <span m="1318640">And</span> <span m="1318770">we</span> <span m="1318890">get</span> <span m="1318990">a</span> <span m="1319040">beautifully</span> <span m="1319490">equation.</span> <span m="1320070">We</span> <span m="1320150">see</span> <span m="1320380">that</span> <span m="1320660">the</span> <span m="1320840">encryption</span> <span m="1321990">is</span> <span m="1322250">congruent</span> <span m="1322920">to</span> <span m="1323030">the</span> <span m="1323220">plain</span> <span m="1323630">message,</span> <span m="1324260">times</span> <span m="1324600">the</span> <span m="1324740">key</span> <span m="1325080">modulo</span> <span m="1325560">p.</span> </p>
<p><span m="1326930">So</span> <span m="1327140">how</span> <span m="1327280">do</span> <span m="1327420">I</span> <span m="1327520">do</span> <span m="1328000">decryption?</span> <span m="1329140">I</span> <span m="1329250">can</span> <span m="1329470">use</span> <span m="1329850">the</span> <span m="1330140">multiplicative</span> <span m="1330850">inverse</span> <span m="1331300">of</span> <span m="1331460">k,</span> <span m="1331730">right?</span> <span m="1332330">So</span> <span m="1332530">then</span> <span m="1333430">I</span> <span m="1333580">can</span> <span m="1334430">divide</span> <span m="1334850">k</span> <span m="1335180">out.</span> <span m="1338770">So</span> <span m="1338960">let's</span> <span m="1339160">write</span> <span m="1339360">this</span> <span m="1339550">out</span> <span m="1339890">as</span> <span m="1340030">well.</span> <span m="1340640">So</span> <span m="1340920">suppose</span> <span m="1341840">I</span> <span m="1342010">have</span> <span m="1342450">a</span> <span m="1343030">multiplicative</span> <span m="1344000">inverse--</span> <span m="1345410">k</span> <span m="1346340">to</span> <span m="1346490">the</span> <span m="1346580">power</span> <span m="1346820">minus</span> <span m="1347200">1--</span> <span m="1348420">that</span> <span m="1348670">is</span> <span m="1348830">congruent</span> <span m="1349440">to</span> <span m="1349610">1</span> <span m="1350330">modulo</span> <span m="1350880">p.</span> <span m="1353230">Why</span> <span m="1353330">do</span> <span m="1353580">I</span> <span m="1354250">do</span> <span m="1354420">this?</span> <span m="1354710">Why</span> <span m="1355670">am I</span> <span m="1356110">writing</span> <span m="1356400">this</span> <span m="1356650">out?</span> <span m="1356870">Because</span> <span m="1358440">you</span> <span m="1358600">will</span> <span m="1358700">see</span> <span m="1359180">that it is</span> <span m="1359340">not</span> <span m="1359480">always</span> <span m="1359950">possible</span> <span m="1360660">to</span> <span m="1360800">have</span> <span m="1360950">a</span> <span m="1361080">multiplicative</span> <span m="1361750">inverse.</span> <span m="1362840">That's</span> <span m="1363080">going</span> <span m="1363220">to</span> <span m="1363320">be</span> <span m="1363500">really</span> <span m="1363770">a</span> <span m="1363820">big</span> <span m="1364020">problem.</span> <span m="1365170">And</span> <span m="1365280">that's</span> <span m="1366590">where</span> <span m="1367810">all</span> <span m="1368020">these</span> <span m="1368320">other</span> <span m="1369880">functions</span> <span m="1370380">come in--</span> <span m="1370740">the</span> <span m="1371140">Euler totient</span> <span m="1371470">function</span> <span m="1372170">and</span> <span m="1372470">Euler's</span> <span m="1372830">theorem,</span> <span m="1373330">and</span> <span m="1373450">so</span> <span m="1373650">on.</span> </p>
<p><span m="1375020">So</span> <span m="1375060">it's</span> <span m="1375370">not</span> <span m="1375420">really</span> <span m="1376220">always</span> <span m="1376590">the</span> <span m="1376690">case.</span> <span m="1376910">We'll</span> <span m="1377090">give</span> <span m="1377180">an</span> <span m="1377240">example</span> <span m="1377720">in</span> <span m="1377810">a</span> <span m="1377880">moment.</span> <span m="1378410">But</span> <span m="1378460">suppose</span> <span m="1379800">that</span> <span m="1380010">we</span> <span m="1380160">have</span> <span m="1380470">a</span> <span m="1380560">multiplicative</span> <span m="1381320">inverse--</span> <span m="1382150">modulo</span> <span m="1382610">p--</span> <span m="1383890">well,</span> <span m="1384100">then</span> <span m="1385770">I'm</span> <span m="1386030">able</span> <span m="1386330">to</span> <span m="1386710">easily</span> <span m="1387230">compute.</span> <span m="1388130">I</span> <span m="1388405">take</span> <span m="1388680">m</span> <span m="1388920">prime,</span> <span m="1390050">I</span> <span m="1390140">multiply</span> <span m="1390450">it</span> <span m="1390760">with</span> <span m="1391100">k</span> <span m="1391720">inverse.</span> <span m="1393810">Well,</span> <span m="1395470">I'm</span> <span m="1395590">substituting</span> <span m="1396310">for</span> <span m="1396480">m</span> <span m="1396680">prime,</span> <span m="1397240">m</span> <span m="1397460">times</span> <span m="1397670">k--</span> <span m="1401070">times</span> <span m="1401630">k</span> <span m="1402230">inverse.</span> <span m="1402600">I</span> <span m="1402630">still</span> <span m="1402890">have</span> <span m="1403080">this</span> <span m="1403290">left.</span> <span m="1404500">Now</span> <span m="1404660">I</span> <span m="1404730">can</span> <span m="1404940">say</span> <span m="1405230">that</span> <span m="1406840">this</span> <span m="1407000">is</span> <span m="1407140">equal</span> <span m="1407490">to</span> <span m="1408000">1</span> <span m="1408420">modulo</span> <span m="1409320">p.</span> <span m="1412220">So</span> <span m="1412430">this</span> <span m="1412660">is</span> <span m="1412820">equal,</span> <span m="1413580">or</span> <span m="1413790">is</span> <span m="1413980">congruent,</span> <span m="1414520">to</span> <span m="1414810">m</span> <span m="1415190">modulo</span> <span m="1417750">p.</span> <span m="1419030">So</span> <span m="1419200">now</span> <span m="1419440">we</span> <span m="1419560">see</span> <span m="1419910">how</span> <span m="1420070">we</span> <span m="1420160">can</span> <span m="1420310">do</span> <span m="1420400">decryption.</span> <span m="1421440">We</span> <span m="1421520">simply</span> <span m="1422050">use</span> <span m="1422350">the</span> <span m="1422430">multiplicative</span> <span m="1423130">inverse</span> <span m="1423530">of</span> <span m="1423690">k.</span> <span m="1425090">And</span> <span m="1425870">as in</span> <span m="1426270">the</span> <span m="1426340">first</span> <span m="1426910">Turing</span> <span m="1427610">code,</span> <span m="1428570">we</span> <span m="1428700">are</span> <span m="1428870">able</span> <span m="1429210">to</span> <span m="1429330">somehow</span> <span m="1430610">divide</span> <span m="1431140">out--</span> <span m="1431430">so</span> <span m="1431590">where</span> <span m="1431710">did</span> <span m="1431820">I</span> <span m="1432080">have</span> <span m="1432170">it--</span> <span m="1432890">to</span> <span m="1433050">divide</span> <span m="1433490">out</span> <span m="1433730">k.</span> <span m="1434640">I</span> <span m="1434750">did</span> <span m="1434900">it</span> <span m="1435050">very</span> <span m="1435220">differently--</span> <span m="1435660">I have</span> <span m="1435820">a</span> <span m="1435860">very</span> <span m="1436120">different</span> <span m="1436470">mathematical</span> <span m="1437000">structure--</span> <span m="1438300">but</span> <span m="1438970">the</span> <span m="1439580">idea</span> <span m="1439870">is,</span> <span m="1440010">essentially,</span> <span m="1440460">the</span> <span m="1440560">same.</span> <span m="1441090">I</span> <span m="1441340">have</span> <span m="1441730">a</span> <span m="1442140">multiplicative</span> <span m="1442930">inverse</span> <span m="1443600">of</span> <span m="1443820">k,</span> <span m="1444720">and</span> <span m="1444850">if</span> <span m="1444990">I</span> <span m="1445030">multiply</span> <span m="1445700">this</span> <span m="1445970">with</span> <span m="1446170">the</span> <span m="1446260">encryption,</span> <span m="1447710">I</span> <span m="1447830">will</span> <span m="1448070">get</span> <span m="1448170">the</span> <span m="1448270">plain</span> <span m="1448550">message,</span> <span m="1449490">modulo</span> <span m="1449750">p.</span> </p>
<p><span m="1450920">So,</span> <span m="1451880">am</span> <span m="1452040">I</span> <span m="1452130">finished</span> <span m="1452630">now</span> <span m="1452840">is</span> <span m="1452990">the</span> <span m="1453090">question.</span> <span m="1453660">Well,</span> <span m="1455160">I</span> <span m="1455320">know</span> <span m="1455620">that</span> <span m="1455770">m</span> <span m="1456270">is</span> <span m="1456370">in</span> <span m="1456480">the</span> <span m="1456600">range</span> <span m="1459420">of</span> <span m="1459840">0,</span> <span m="1460240">1,</span> <span m="1460690">all</span> <span m="1460860">the</span> <span m="1460950">way</span> <span m="1461090">up to p</span> <span m="1461270">minus</span> <span m="1461980">1.</span> <span m="1463480">So</span> <span m="1465320">this</span> <span m="1465540">means</span> <span m="1466150">that</span> <span m="1466310">I</span> <span m="1466530">can</span> <span m="1466850">also</span> <span m="1467300">rewrite</span> <span m="1467920">m</span> <span m="1468740">as--</span> <span m="1469150">and</span> <span m="1469310">I</span> <span m="1469370">use</span> <span m="1469730">a</span> <span m="1469840">similar</span> <span m="1470010">trick</span> <span m="1470420">as what</span> <span m="1470590">I</span> <span m="1470670">did</span> <span m="1470890">over</span> <span m="1471200">here--</span> <span m="1472300">I</span> <span m="1472380">can</span> <span m="1472620">rewrite</span> <span m="1473110">m</span> <span m="1474120">as</span> <span m="1474470">they</span> <span m="1474550">remainder</span> <span m="1476590">of</span> <span m="1477220">m</span> <span m="1477550">prime</span> <span m="1478050">times</span> <span m="1478540">k</span> <span m="1479090">inverse,</span> <span m="1480690">after</span> <span m="1480950">dividing</span> <span m="1481470">out</span> <span m="1481650">as</span> <span m="1481780">many</span> <span m="1482080">copies</span> <span m="1482450">of</span> <span m="1482730">p</span> <span m="1482770">as</span> <span m="1482920">possible.</span> <span m="1485210">So</span> <span m="1486340">what</span> <span m="1486500">we</span> <span m="1486620">did</span> <span m="1486820">here</span> <span m="1487400">is</span> <span m="1487650">to</span> <span m="1487760">first</span> <span m="1488200">prove</span> <span m="1488590">that</span> <span m="1488870">the</span> <span m="1489000">difference</span> <span m="1489580">between</span> <span m="1489970">those</span> <span m="1490330">two</span> <span m="1491180">is</span> <span m="1491350">a</span> <span m="1491510">multiple</span> <span m="1492000">of</span> <span m="1492150">p.</span> <span m="1493290">That's</span> <span m="1493470">essentially</span> <span m="1494040">what</span> <span m="1495200">congruent</span> <span m="1496060">modulo</span> <span m="1496520">p</span> <span m="1496730">means--</span> <span m="1497240">that's</span> <span m="1497430">the</span> <span m="1497500">definition.</span> <span m="1499350">So</span> <span m="1499500">now</span> <span m="1499690">that</span> <span m="1499840">I</span> <span m="1499910">know</span> <span m="1500170">that</span> <span m="1500440">the</span> <span m="1500540">difference</span> <span m="1501060">is</span> <span m="1501270">a</span> <span m="1501320">multiple</span> <span m="1501800">of</span> <span m="1501930">p,</span> <span m="1502890">and</span> <span m="1504070">if</span> <span m="1504430">I</span> <span m="1504810">know</span> <span m="1505110">that</span> <span m="1505350">m</span> <span m="1505830">is</span> <span m="1506030">actually</span> <span m="1506470">in</span> <span m="1506640">this</span> <span m="1507010">range</span> <span m="1507520">up</span> <span m="1507700">to p</span> <span m="1508030">minus</span> <span m="1508410">1,</span> <span m="1509350">I</span> <span m="1509490">can</span> <span m="1509710">use</span> <span m="1510480">what</span> <span m="1510670">we</span> <span m="1510790">learned</span> <span m="1511710">last</span> <span m="1512090">lecture--</span> <span m="1512460">and</span> <span m="1512530">what</span> <span m="1512660">the</span> <span m="1512740">book</span> <span m="1512940">was</span> <span m="1513090">talking</span> <span m="1513440">about--</span> <span m="1514370">that</span> <span m="1515550">the</span> <span m="1515660">definition</span> <span m="1516230">of</span> <span m="1516360">the</span> <span m="1516580">remainder</span> <span m="1517590">of</span> <span m="1517800">m</span> <span m="1518160">prime</span> <span m="1518490">times</span> <span m="1518790">k</span> <span m="1519070">inverse--</span> <span m="1519480">this</span> <span m="1519660">thing--</span> <span m="1520400">after</span> <span m="1520670">finding</span> <span m="1520970">out</span> <span m="1521120">as</span> <span m="1521220">many</span> <span m="1521440">copies</span> <span m="1521740">of</span> <span m="1521890">p,</span> <span m="1522350">is</span> <span m="1522520">exactly</span> <span m="1523230">this plain</span> <span m="1523600">message</span> <span m="1524080">m.</span> </p>
<p><span m="1525440">OK,</span> <span m="1525680">so</span> <span m="1525840">now</span> <span m="1526020">we</span> <span m="1526120">the</span> <span m="1526380">decryption.</span> <span m="1527380">So</span> <span m="1527460">this</span> <span m="1527650">is</span> <span m="1527760">decryption.</span> <span m="1530870">And</span> <span m="1533340">that</span> <span m="1533490">sounds</span> <span m="1533810">great.</span> <span m="1535040">So</span> <span m="1535270">now,</span> <span m="1536000">of</span> <span m="1536220">course,</span> <span m="1536540">we are</span> <span m="1536740">wondering,</span> <span m="1538210">well,</span> <span m="1538520">if</span> <span m="1538750">we</span> <span m="1539390">can</span> <span m="1539640">do</span> <span m="1539860">this,</span> <span m="1540330">can</span> <span m="1540500">we</span> <span m="1540700">also</span> <span m="1541850">attack</span> <span m="1542210">this</span> <span m="1542380">scheme,</span> <span m="1542740">right?</span> <span m="1543170">Can</span> <span m="1543350">we</span> <span m="1543850">do</span> <span m="1543960">something</span> <span m="1544380">bad</span> <span m="1544700">with</span> <span m="1544860">it?</span> <span m="1546920">Well,</span> <span m="1547020">it</span> <span m="1547200">can</span> <span m="1547430">be</span> <span m="1547540">used</span> <span m="1548090">to</span> <span m="1548200">break</span> <span m="1548480">this</span> <span m="1548720">code,</span> <span m="1549380">but</span> <span m="1549540">in</span> <span m="1549670">a</span> <span m="1549730">slightly</span> <span m="1550880">more</span> <span m="1551730">complicated</span> <span m="1552450">way.</span> </p>
<p><span m="1555700">So</span> <span m="1556340">let's</span> <span m="1556480">see where</span> <span m="1557160">I</span> <span m="1557330">put</span> <span m="1557610">that.</span> <span m="1559750">Right,</span> <span m="1560230">so</span> <span m="1560960">what we are</span> <span m="1561330">going</span> <span m="1561610">to</span> <span m="1561740">use,</span> <span m="1562160">now--</span> <span m="1563660">so</span> <span m="1564180">when</span> <span m="1564290">we</span> <span m="1564400">talk</span> <span m="1564620">about</span> <span m="1564880">security,</span> <span m="1565660">and</span> <span m="1565690">so</span> <span m="1565910">on,</span> <span m="1566700">you</span> <span m="1566880">can</span> <span m="1567030">think</span> <span m="1567350">of</span> <span m="1567490">all</span> <span m="1567750">kinds</span> <span m="1568060">of</span> <span m="1568210">ways</span> <span m="1568560">to</span> <span m="1568920">break</span> <span m="1570000">an</span> <span m="1570120">encryption</span> <span m="1570540">scheme.</span> <span m="1570940">So</span> <span m="1571610">we</span> <span m="1571710">started</span> <span m="1572120">out</span> <span m="1572430">with,</span> <span m="1573300">in</span> <span m="1573520">the</span> <span m="1573630">first</span> <span m="1574020">version,</span> <span m="1574620">well,</span> <span m="1574840">what</span> <span m="1575000">if</span> <span m="1575220">I</span> <span m="1575300">just</span> <span m="1575680">know the</span> <span m="1575960">encryption?</span> <span m="1577140">And</span> <span m="1577360">then,</span> <span m="1578640">well,</span> <span m="1578980">I</span> <span m="1579070">cannot</span> <span m="1579490">know</span> <span m="1579660">anything</span> <span m="1580420">about</span> <span m="1581010">the</span> <span m="1581300">plain</span> <span m="1581670">text,</span> <span m="1581940">simply</span> <span m="1582210">because</span> <span m="1582620">I</span> <span m="1583150">know that</span> <span m="1583600">it's very</span> <span m="1583800">hard</span> <span m="1584050">to</span> <span m="1584140">factor</span> <span m="1585290">a</span> <span m="1585340">product</span> <span m="1585720">of</span> <span m="1585830">two</span> <span m="1586000">large</span> <span m="1586310">primes.</span> <span m="1587080">Then</span> <span m="1587310">I</span> <span m="1587380">said,</span> <span m="1587670">but</span> <span m="1587980">suppose</span> <span m="1588440">I</span> <span m="1588640">know</span> <span m="1589100">a</span> <span m="1589170">little</span> <span m="1589430">bit</span> <span m="1589600">more</span> <span m="1589920">as</span> <span m="1590050">an</span> <span m="1590120">adversary.</span> <span m="1590660">Suppose</span> <span m="1591090">I</span> <span m="1591550">have</span> <span m="1591920">a</span> <span m="1592070">plain</span> <span m="1592380">message</span> <span m="1592930">together</span> <span m="1593580">with</span> <span m="1593810">an</span> <span m="1595830">encrypted</span> <span m="1596410">message.</span> <span m="1597430">Well,</span> <span m="1597700">then</span> <span m="1597920">I</span> <span m="1598230">could</span> <span m="1598440">do</span> <span m="1598580">this</span> <span m="1598810">GCD</span> <span m="1599100">trick</span> <span m="1599600">and</span> <span m="1600070">figure</span> <span m="1600470">out</span> <span m="1601160">and</span> <span m="1601300">break</span> <span m="1601530">the</span> <span m="1601600">scheme.</span> <span m="1603000">And</span> <span m="1603460">now</span> <span m="1603700">we're</span> <span m="1603840">going</span> <span m="1604040">to</span> <span m="1604120">do</span> <span m="1604230">something</span> <span m="1604590">similar.</span> <span m="1605310">And</span> <span m="1605490">we</span> <span m="1605600">say,</span> <span m="1605960">well,</span> <span m="1606580">suppose</span> <span m="1610110">that</span> <span m="1610310">I</span> <span m="1610350">do</span> <span m="1610480">not</span> <span m="1610720">know</span> <span m="1610970">two</span> <span m="1611190">encryptions,</span> <span m="1612290">but</span> <span m="1612480">I</span> <span m="1612550">know</span> <span m="1613680">a</span> <span m="1613810">plain</span> <span m="1614220">message.</span> <span m="1615470">And</span> <span m="1615770">in</span> <span m="1616790">corresponding,</span> <span m="1617570">encrypted</span> <span m="1618070">message.</span> <span m="1619000">So</span> <span m="1619150">if</span> <span m="1619310">I</span> <span m="1619360">know</span> <span m="1619850">such</span> <span m="1620160">a</span> <span m="1620230">pair,</span> <span m="1620600">which</span> <span m="1620780">is--</span> <span m="1621370">I</span> <span m="1621430">mean,</span> <span m="1621610">in</span> <span m="1621670">practice,</span> <span m="1623170">such</span> <span m="1623450">type</span> <span m="1623620">of</span> <span m="1623740">information</span> <span m="1624240">will</span> <span m="1624400">be</span> <span m="1624800">leaked.</span> <span m="1626220">Then</span> <span m="1626500">in</span> <span m="1626630">this</span> <span m="1626850">case,</span> <span m="1627170">I</span> <span m="1627270">can</span> <span m="1627290">break</span> <span m="1627630">it.</span> </p>
<p><span m="1627740">So</span> <span m="1628300">we</span> <span m="1628410">call</span> <span m="1628670">this</span> <span m="1628920">the</span> <span m="1629010">known</span> <span m="1630220">the</span> <span m="1630290">plain</span> <span m="1630650">text</span> <span m="1630950">attack.</span> <span m="1632700">And</span> <span m="1635650">it</span> <span m="1636540">assumes</span> <span m="1637580">that</span> <span m="1638790">we</span> <span m="1639050">know--</span> <span m="1639990">as</span> <span m="1640160">an</span> <span m="1640250">adversary,</span> <span m="1641760">I</span> <span m="1641920">know</span> <span m="1643390">a</span> <span m="1644090">message--</span> <span m="1645500">a</span> <span m="1645590">plain</span> <span m="1645960">message,</span> <span m="1647700">m--</span> <span m="1649300">and</span> <span m="1649520">also</span> <span m="1651010">an</span> <span m="1651160">encryption</span> <span m="1651680">of</span> <span m="1651800">this</span> <span m="1651970">message,</span> <span m="1658710">m</span> <span m="1658870">prime.</span> <span m="1660330">And m</span> <span m="1660690">prime,</span> <span m="1661040">according</span> <span m="1661430">to</span> <span m="1661560">this</span> <span m="1661670">scheme,</span> <span m="1662300">is</span> <span m="1662540">the</span> <span m="1662610">remainder</span> <span m="1664070">of</span> <span m="1665160">m</span> <span m="1665480">times</span> <span m="1665860">k,</span> <span m="1666730">after</span> <span m="1666950">the</span> <span m="1667050">dividing</span> <span m="1667450">out</span> <span m="1667590">as</span> <span m="1667720">many</span> <span m="1667940">multiples</span> <span m="1668460">of</span> <span m="1668600">p</span> <span m="1668760">as</span> <span m="1668890">possible.</span> <span m="1671480">Now,</span> <span m="1671560">we</span> <span m="1671680">saw--</span> <span m="1672950">now,</span> <span m="1673060">suppose</span> <span m="1673500">I</span> <span m="1673550">know these</span> <span m="1674040">two.</span> <span m="1674330">I'm</span> <span m="1674440">going</span> <span m="1674640">to</span> <span m="1674740">show</span> <span m="1675060">you</span> <span m="1675240">how</span> <span m="1675370">to</span> <span m="1675480">break</span> <span m="1675810">it.</span> <span m="1676550">So</span> <span m="1677250">let's</span> <span m="1677430">have</span> <span m="1677600">a</span> <span m="1677670">look.</span> </p>
<p><span m="1679750">The</span> <span m="1680130">encryption,</span> <span m="1680720">m</span> <span m="1680930">prime,</span> <span m="1682000">is</span> <span m="1682380">congruent</span> <span m="1682890">to</span> <span m="1683070">m</span> <span m="1683340">times</span> <span m="1683810">k</span> <span m="1684350">modulo</span> <span m="1684860">p.</span> <span m="1686160">We</span> <span m="1686390">just</span> <span m="1686560">proved</span> <span m="1686870">it</span> <span m="1686970">over</span> <span m="1687240">here.</span> <span m="1689100">And</span> <span m="1691150">what</span> <span m="1691290">do</span> <span m="1691390">we</span> <span m="1691530">know?</span> <span m="1691740">We</span> <span m="1691850">know that</span> <span m="1692320">p</span> <span m="1692700">is</span> <span m="1692920">a</span> <span m="1693500">public</span> <span m="1693920">prime.</span> <span m="1694400">I</span> <span m="1694530">know</span> <span m="1694860">p.</span> <span m="1696590">Since</span> <span m="1696870">it's</span> <span m="1697070">a</span> <span m="1697140">prime,</span> <span m="1698090">I</span> <span m="1698260">know</span> <span m="1698540">that</span> <span m="1698930">the</span> <span m="1699150">GCD</span> <span m="1700430">of</span> <span m="1700760">m</span> <span m="1701310">and</span> <span m="1701640">p</span> <span m="1702080">equals</span> <span m="1702470">1.</span> <span m="1704290">So</span> <span m="1704980">these</span> <span m="1705300">two</span> <span m="1705480">are</span> <span m="1705630">relatively</span> <span m="1706250">prime.</span> <span m="1706630">So</span> <span m="1706800">now</span> <span m="1707010">if</span> <span m="1707130">they</span> <span m="1707210">are</span> <span m="1707310">relatively</span> <span m="1707900">prime--</span> <span m="1709500">and</span> <span m="1709640">that's</span> <span m="1709800">what</span> <span m="1709920">we</span> <span m="1710060">wrote</span> <span m="1710290">up</span> <span m="1710470">here--</span> <span m="1711620">we</span> <span m="1711680">know</span> <span m="1712130">that</span> <span m="1712360">there</span> <span m="1712750">exists</span> <span m="1712990">this</span> <span m="1713160">linear</span> <span m="1713430">combination</span> <span m="1715080">of,</span> <span m="1716200">in</span> <span m="1716330">this</span> <span m="1716640">case,</span> <span m="1719230">m</span> <span m="1719430">and</span> <span m="1719570">p</span> <span m="1720420">that</span> <span m="1720800">is</span> <span m="1721070">equal</span> <span m="1721320">to</span> <span m="1721470">1.</span> <span m="1723310">And</span> <span m="1723570">this</span> <span m="1723810">way</span> <span m="1724220">we</span> <span m="1724370">can</span> <span m="1724580">figure</span> <span m="1724990">out</span> <span m="1725550">how</span> <span m="1725740">to</span> <span m="1725910">compute</span> <span m="1727115">the</span> <span m="1727510">inverse--</span> <span m="1728640">the</span> <span m="1728730">multiplicative</span> <span m="1729450">inverse</span> <span m="1729930">of</span> <span m="1730090">m.</span> </p>
<p><span m="1731590">So</span> <span m="1732860">that's</span> <span m="1733060">what</span> <span m="1733200">we're</span> <span m="1733370">going</span> <span m="1733570">to</span> <span m="1733700">do.</span> <span m="1734020">So</span> <span m="1735350">we</span> <span m="1735490">can</span> <span m="1735650">compute</span> <span m="1737760">and</span> <span m="1738220">the</span> <span m="1738300">multiplicative</span> <span m="1739350">inverse,</span> <span m="1741530">such</span> <span m="1741870">that</span> <span m="1742720">m</span> <span m="1743060">times</span> <span m="1743540">m</span> <span m="1744380">inverse</span> <span m="1745250">is</span> <span m="1745490">congruent</span> <span m="1746050">to</span> <span m="1746210">1</span> <span m="1747080">modulo</span> <span m="1748840">p.</span> <span m="1752040">So</span> <span m="1752260">now</span> <span m="1752450">we</span> <span m="1752580">can</span> <span m="1752730">do</span> <span m="1752830">the</span> <span m="1752910">next</span> <span m="1753210">step.</span> <span m="1755190">So</span> <span m="1755820">what</span> <span m="1756810">could</span> <span m="1756920">I</span> <span m="1757050">do</span> <span m="1757190">next?</span> <span m="1757780">So</span> <span m="1758760">let's</span> <span m="1759010">see,</span> <span m="1759370">if</span> <span m="1759550">I</span> <span m="1759630">have</span> <span m="1759860">such</span> <span m="1760110">an</span> <span m="1760250">inverse,</span> <span m="1761890">then</span> <span m="1762190">I</span> <span m="1762320">can</span> <span m="1762550">take</span> <span m="1762840">my</span> <span m="1763620">encrypted</span> <span m="1764780">message</span> <span m="1765530">that</span> <span m="1765640">I</span> <span m="1765830">have</span> <span m="1766240">as</span> <span m="1766400">an</span> <span m="1766510">attacker,</span> <span m="1767400">which is</span> <span m="1767720">m</span> <span m="1767960">prime.</span> <span m="1770330">I</span> <span m="1770450">know</span> <span m="1770970">m,</span> <span m="1771550">and</span> <span m="1772060">since</span> <span m="1772440">p</span> <span m="1772510">was</span> <span m="1772820">public,</span> <span m="1773310">I</span> <span m="1773380">can</span> <span m="1773600">compute</span> <span m="1774160">this</span> <span m="1774740">multiplicative</span> <span m="1775520">inverse.</span> <span m="1776150">So</span> <span m="1776350">I</span> <span m="1776420">could</span> <span m="1776550">just</span> <span m="1776780">compute</span> <span m="1777280">this</span> <span m="1779110">product,</span> <span m="1780370">and</span> <span m="1780580">I</span> <span m="1780640">know</span> <span m="1781670">that</span> <span m="1781800">this</span> <span m="1782000">is</span> <span m="1782110">actually</span> <span m="1782510">equal</span> <span m="1782920">to,</span> <span m="1783560">well,</span> <span m="1784680">k</span> <span m="1784910">times</span> <span m="1785360">m</span> <span m="1785680">times</span> <span m="1786350">m</span> <span m="1786620">inverse.</span> <span m="1787580">This</span> <span m="1787760">is</span> <span m="1787870">again</span> <span m="1788150">equal</span> <span m="1788500">to--</span> <span m="1789730">congruent to</span> <span m="1789830">1</span> <span m="1789990">modulo</span> <span m="1790400">p.</span> <span m="1791370">So</span> <span m="1791480">this</span> <span m="1791660">is</span> <span m="1791760">equal</span> <span m="1792020">to</span> <span m="1792240">k</span> <span m="1792870">modulo</span> <span m="1793320">p.</span> </p>
<p><span m="1795700">So</span> <span m="1795930">now,</span> <span m="1796230">all</span> <span m="1796550">of a</span> <span m="1796830">sudden,</span> <span m="1797170">I</span> <span m="1797310">know</span> <span m="1797590">k</span> <span m="1798020">modulo</span> <span m="1798520">p,</span> <span m="1799080">because</span> <span m="1799420">I</span> <span m="1799440">know</span> <span m="1799630">those</span> <span m="1799920">two.</span> <span m="1801060">So</span> <span m="1801230">if</span> <span m="1801410">I</span> <span m="1801470">know</span> <span m="1801640">k,</span> <span m="1802340">I</span> <span m="1802470">can</span> <span m="1802690">compute</span> <span m="1804420">its</span> <span m="1804650">multiplicative</span> <span m="1805420">inverse.</span> <span m="1806990">So I can</span> <span m="1807420">compute</span> <span m="1808630">k</span> <span m="1808980">inverse</span> <span m="1810590">modulo</span> <span m="1811080">p.</span> <span m="1813230">And</span> <span m="1813380">if</span> <span m="1813520">I</span> <span m="1813580">know</span> <span m="1813780">k</span> <span m="1814080">inverse,</span> <span m="1815150">again,</span> <span m="1815820">I</span> <span m="1815930">can</span> <span m="1816150">use</span> <span m="1816490">it</span> <span m="1817240">to</span> <span m="1817490">decrypt</span> <span m="1817970">any</span> <span m="1818330">other</span> <span m="1819530">encrypted</span> <span m="1820010">message</span> <span m="1820690">that</span> <span m="1820890">I</span> <span m="1820960">receive.</span> <span m="1822290">So</span> <span m="1823050">for</span> <span m="1823320">all</span> <span m="1823620">future</span> <span m="1824110">encrypted</span> <span m="1824550">messages,</span> <span m="1825220">I</span> <span m="1825290">do</span> <span m="1825400">not</span> <span m="1825710">need</span> <span m="1825990">anymore</span> <span m="1826750">the</span> <span m="1826870">plain</span> <span m="1827170">messages.</span> <span m="1828460">I've</span> <span m="1828770">already</span> <span m="1829950">used--</span> <span m="1830770">just</span> <span m="1831050">by</span> <span m="1831190">using</span> <span m="1831580">one</span> <span m="1832190">plain</span> <span m="1832510">message</span> <span m="1832990">encryption</span> <span m="1833580">pair,</span> <span m="1834850">I</span> <span m="1835060">have</span> <span m="1835250">been</span> <span m="1835400">able</span> <span m="1835630">to</span> <span m="1835750">compute</span> <span m="1836230">the</span> <span m="1836280">secret</span> <span m="1836720">key,</span> <span m="1837280">and</span> <span m="1837800">the</span> <span m="1837980">whole</span> <span m="1838160">scheme</span> <span m="1838490">is</span> <span m="1838590">broken.</span> </p>
<p><span m="1839990">So</span> <span m="1840150">security</span> <span m="1841880">is</span> <span m="1842040">kind</span> <span m="1842240">of</span> <span m="1842595">an</span> <span m="1842860">interesting</span> <span m="1845230">science.</span> <span m="1846890">We</span> <span m="1847130">can</span> <span m="1847310">always</span> <span m="1847640">think</span> <span m="1847810">of</span> <span m="1848240">more</span> <span m="1848550">tricks</span> <span m="1849040">to</span> <span m="1849420">break</span> <span m="1849970">schemes,</span> <span m="1850450">or</span> <span m="1850570">other</span> <span m="1851190">assumptions,</span> <span m="1853480">that</span> <span m="1853630">we</span> <span m="1853700">haven't</span> <span m="1853980">thought</span> <span m="1854200">about</span> <span m="1854490">before.</span> <span m="1856070">And</span> <span m="1857240">so</span> <span m="1857550">now,</span> <span m="1857760">let's</span> <span m="1858520">talk</span> <span m="1858850">about--</span> <span m="1860840">so</span> <span m="1861040">what</span> <span m="1861190">did</span> <span m="1861340">we</span> <span m="1861450">do</span> <span m="1861730">here?</span> <span m="1864750">We</span> <span m="1864930">have</span> <span m="1865090">been</span> <span m="1865220">talking</span> <span m="1865650">about</span> <span m="1867640">encryption--</span> <span m="1869500">these</span> <span m="1869700">two</span> <span m="1869870">schemes.</span> <span m="1870900">We</span> <span m="1871020">talked</span> <span m="1871300">about</span> <span m="1871570">modular</span> <span m="1872140">arithmetic.</span> <span m="1874050">We</span> <span m="1874240">talked</span> <span m="1874350">about</span> <span m="1874570">congruence,</span> <span m="1875580">and</span> <span m="1875810">also</span> <span m="1876060">the</span> <span m="1876130">multiplicative</span> <span m="1876920">inverse.</span> <span m="1878060">And</span> <span m="1878210">we</span> <span m="1878320">showed</span> <span m="1878790">how</span> <span m="1879030">to</span> <span m="1880420">use</span> <span m="1880780">that</span> <span m="1880990">to</span> <span m="1881110">break</span> <span m="1881440">Turing's</span> <span m="1881740">code,</span> <span m="1882150">version</span> <span m="1882490">number</span> <span m="1882750">two.</span> </p>
<p><span m="1884080">So</span> <span m="1884760">we</span> <span m="1884870">need</span> <span m="1885090">something</span> <span m="1885460">much</span> <span m="1885740">more</span> <span m="1885910">fundamental</span> <span m="1886910">in</span> <span m="1887130">order</span> <span m="1887460">to</span> <span m="1888130">create</span> <span m="1888470">a</span> <span m="1888520">scheme</span> <span m="1889250">that</span> <span m="1889440">is</span> <span m="1889630">really</span> <span m="1889880">secure.</span> <span m="1890300">And</span> <span m="1890470">that's</span> <span m="1890580">what we're</span> <span m="1891010">going to</span> <span m="1891110">do</span> <span m="1891290">now.</span> <span m="1892070">We're</span> <span m="1892160">going</span> <span m="1892370">to</span> <span m="1892490">start</span> <span m="1892830">off</span> <span m="1893020">with</span> <span m="1893200">Euler's</span> <span m="1894450">totient</span> <span m="1894780">function,</span> <span m="1895820">and</span> <span m="1895990">improve</span> <span m="1896580">a</span> <span m="1896700">related</span> <span m="1897370">theorem.</span> <span m="1898780">And</span> <span m="1899070">with</span> <span m="1899310">that</span> <span m="1899560">we</span> <span m="1899810">will</span> <span m="1899950">be</span> <span m="1900090">able</span> <span m="1900430">to</span> <span m="1900710">actually</span> <span m="1902260">explain</span> <span m="1903070">RSA</span> <span m="1903500">algorithm,</span> <span m="1904080">which</span> <span m="1904150">is</span> <span m="1904280">a</span> <span m="1904330">famous</span> <span m="1904730">algorithm</span> <span m="1905740">invented</span> <span m="1906290">here</span> <span m="1906490">at</span> <span m="1906590">MIT</span> <span m="1907160">in</span> <span m="1907260">1977,</span> <span m="1908360">by</span> <span m="1910030">Rivest,</span> <span m="1911180">Shamir,</span> <span m="1911630">and</span> <span m="1911790">Adleman.</span> <span m="1912760">And</span> <span m="1913960">they</span> <span m="1914130">actually</span> <span m="1914430">also</span> <span m="1914960">got</span> <span m="1915110">the</span> <span m="1915190">Turing</span> <span m="1915510">Award</span> <span m="1915820">for</span> <span m="1916000">this</span> <span m="1916240">a</span> <span m="1916300">few</span> <span m="1916520">years</span> <span m="1916810">ago.</span> <span m="1918600">And</span> <span m="1918760">it's</span> <span m="1919020">widely</span> <span m="1919400">used</span> <span m="1920730">in</span> <span m="1921220">practice.</span> <span m="1923200">But</span> <span m="1923620">we will</span> <span m="1923760">be</span> <span m="1923900">able</span> <span m="1924230">to</span> <span m="1924360">actually</span> <span m="1924670">explain</span> <span m="1925070">this</span> <span m="1925250">algorithm</span> <span m="1926060">with</span> <span m="1926300">just</span> <span m="1926780">this</span> <span m="1927080">fundamental</span> <span m="1927730">piece</span> <span m="1928190">of</span> <span m="1928500">number</span> <span m="1928770">theory.</span> <span m="1929490">So</span> <span m="1929580">that's</span> <span m="1929740">really</span> <span m="1929920">exciting.</span> <span m="1930970">So</span> <span m="1931030">let's</span> <span m="1931250">do</span> <span m="1931410">this.</span> </p>
<p><span m="1936390">So</span> <span m="1936590">we're</span> <span m="1936740">going</span> <span m="1936940">to</span> <span m="1937210">first</span> <span m="1937570">define</span> <span m="1938800">Euler's</span> <span m="1939730">totient</span> <span m="1940030">function.</span> <span m="1951290">And</span> <span m="1951730">it's</span> <span m="1951890">related</span> <span m="1952270">to</span> <span m="1952380">this</span> <span m="1952570">multiplicative</span> <span m="1953250">inverse.</span> <span m="1968510">This</span> <span m="1968750">function</span> <span m="1969270">is</span> <span m="1970160">denoted</span> <span m="1970690">phi</span> <span m="1970940">of n,</span> <span m="1972890">and</span> <span m="1974720">it</span> <span m="1975830">denote</span> <span m="1977590">the</span> <span m="1977830">number</span> <span m="1978250">of</span> <span m="1978370">the</span> <span m="1978430">integers</span> <span m="1990350">in</span> <span m="1991360">1,</span> <span m="1991940">2,</span> <span m="1992420">3--</span> <span m="1993320">all</span> <span m="1993530">the</span> <span m="1993610">way</span> <span m="1993780">up</span> <span m="1993890">to</span> <span m="1994110">n</span> <span m="1994300">minus</span> <span m="1994700">1,</span> <span m="1996250">that</span> <span m="1996460">are</span> <span m="1996700">relatively</span> <span m="1997330">prime</span> <span m="2005150">to</span> <span m="2006602">n.</span> <span m="2009400">So</span> <span m="2012650">this</span> <span m="2012980">just</span> <span m="2013450">drops</span> <span m="2013770">out</span> <span m="2013930">of</span> <span m="2014040">the air,</span> <span m="2014640">you</span> <span m="2014750">may</span> <span m="2014910">think.</span> <span m="2015280">But</span> <span m="2016550">this</span> <span m="2016750">is</span> <span m="2018290">a</span> <span m="2018380">fundamental</span> <span m="2019630">quantity,</span> <span m="2020830">and</span> <span m="2021490">Euler's</span> <span m="2021690">theorem</span> <span m="2022330">is what</span> <span m="2022610">we will</span> <span m="2022920">try</span> <span m="2023080">to</span> <span m="2023200">prove</span> <span m="2023500">next.</span> <span m="2023830">But</span> <span m="2023940">let's</span> <span m="2024160">give</span> <span m="2024640">a</span> <span m="2024760">couple</span> <span m="2024990">of</span> <span m="2025110">examples</span> <span m="2025750">about</span> <span m="2026060">this,</span> <span m="2029200">just</span> <span m="2029440">to</span> <span m="2029530">see</span> <span m="2029760">how</span> <span m="2029980">it</span> <span m="2030030">works.</span> </p>
<p><span m="2033430">So</span> <span m="2033630">for</span> <span m="2033780">example,</span> <span m="2034220">let's</span> <span m="2034470">take</span> <span m="2034760">n</span> <span m="2035110">to</span> <span m="2035220">be</span> <span m="2035410">equal</span> <span m="2035630">to</span> <span m="2035900">12.</span> <span m="2038070">What</span> <span m="2038180">would</span> <span m="2038400">be</span> <span m="2039020">the</span> <span m="2039170">value</span> <span m="2039880">of</span> <span m="2040980">Euler's</span> <span m="2041350">totient</span> <span m="2041700">function,</span> <span m="2042270">evaluated</span> <span m="2043100">for</span> <span m="2043460">12?</span> <span m="2045150">So</span> <span m="2047030">if</span> <span m="2047220">you</span> <span m="2047310">take</span> <span m="2047590">12,</span> <span m="2048150">we</span> <span m="2048330">have</span> <span m="2052969">the</span> <span m="2053080">following</span> <span m="2053560">numbers</span> <span m="2054080">to</span> <span m="2054210">consider.</span> <span m="2055010">1,</span> <span m="2055510">2,</span> <span m="2056010">3,</span> <span m="2056510">4,</span> <span m="2057010">5,</span> <span m="2057510">6,</span> <span m="2058010">7,</span> <span m="2058510">8,</span> <span m="2059010">9,</span> <span m="2059510">10,11,</span> <span m="2061810">and</span> <span m="2061980">12.</span> <span m="2063480">So</span> <span m="2063670">now,</span> <span m="2064100">let's</span> <span m="2064310">have a</span> <span m="2064530">look.</span> <span m="2067996">You</span> <span m="2068370">want</span> <span m="2068620">to</span> <span m="2068719">count</span> <span m="2068940">the</span> <span m="2069030">integers</span> <span m="2069659">that are</span> <span m="2069800">relatively</span> <span m="2070330">prime</span> <span m="2070679">to</span> <span m="2071350">12.</span> <span m="2074429">Well,</span> <span m="2075199">1</span> <span m="2075600">is</span> <span m="2075730">relatively</span> <span m="2076230">prime</span> <span m="2076489">to</span> <span m="2076630">12.</span> <span m="2077230">Why</span> <span m="2077575">is</span> <span m="2077920">that?</span> <span m="2078179">Because</span> <span m="2078480">to</span> <span m="2078659">GCD</span> <span m="2079370">of</span> <span m="2079550">12</span> <span m="2079960">and</span> <span m="2080159">1</span> <span m="2081159">is</span> <span m="2081360">equal</span> <span m="2081570">to</span> <span m="2081710">1,</span> <span m="2082570">and</span> <span m="2082699">that's</span> <span m="2082840">the</span> <span m="2082900">definition</span> <span m="2083500">of</span> <span m="2083620">being</span> <span m="2083810">relatively</span> <span m="2084360">prime.</span> <span m="2084770">So</span> <span m="2084940">this</span> <span m="2085150">is</span> <span m="2085250">a</span> <span m="2085310">good</span> <span m="2085510">number.</span> <span m="2087510">The</span> <span m="2087639">GCD</span> <span m="2088139">of</span> <span m="2088270">12</span> <span m="2088590">and</span> <span m="2088770">2,</span> <span m="2089489">well</span> <span m="2089719">both</span> <span m="2090070">are</span> <span m="2090150">divisible</span> <span m="2090630">by</span> <span m="2090790">2.</span> <span m="2092730">So</span> <span m="2092889">they're</span> <span m="2093090">not</span> <span m="2093449">relatively</span> <span m="2094020">prime,</span> <span m="2094489">because</span> <span m="2095199">the</span> <span m="2095310">GCD</span> <span m="2095685">is</span> <span m="2096060">at</span> <span m="2096159">least</span> <span m="2096429">two.</span> <span m="2096909">In</span> <span m="2097030">this</span> <span m="2097200">case,</span> <span m="2097390">equal</span> <span m="2097650">to</span> <span m="2097770">2.</span> <span m="2099120">3</span> <span m="2099500">also</span> <span m="2099780">divides</span> <span m="2099900">12.</span> <span m="2101388">4</span> <span m="2101884">divides</span> <span m="2102380">12.</span> <span m="2103410">5</span> <span m="2103820">is</span> <span m="2103990">relatively</span> <span m="2104460">prime</span> <span m="2105540">with</span> <span m="2105690">respect</span> <span m="2106020">to</span> <span m="2106120">12.</span> <span m="2107020">6</span> <span m="2108160">actually</span> <span m="2109570">is</span> <span m="2109830">dividing</span> <span m="2110150">12 as</span> <span m="2110560">well.</span> <span m="2111500">7</span> <span m="2111960">is</span> <span m="2112730">relatively</span> <span m="2113020">prime,</span> <span m="2114400">and</span> <span m="2115220">11</span> <span m="2115900">over</span> <span m="2116160">here</span> <span m="2116360">as well.</span> <span m="2116680">And</span> <span m="2116770">all</span> <span m="2116880">the</span> <span m="2116990">others</span> <span m="2117610">have</span> <span m="2118030">a</span> <span m="2118280">greatest</span> <span m="2118660">common</span> <span m="2118890">divisor</span> <span m="2119510">that's</span> <span m="2119820">larger</span> <span m="2120160">than</span> <span m="2120330">1.</span> </p>
<p><span m="2121390">So</span> <span m="2121610">here</span> <span m="2121820">we</span> <span m="2121930">see</span> <span m="2122390">that</span> <span m="2123130">the</span> <span m="2123460">Euler's totient</span> <span m="2123870">function</span> <span m="2125570">evaluated</span> <span m="2126010">in</span> <span m="2126130">12</span> <span m="2126600">is</span> <span m="2126780">equal</span> <span m="2127070">to</span> <span m="2127220">4.</span> <span m="2128100">There</span> <span m="2128270">are</span> <span m="2128330">one,</span> <span m="2128760">two,</span> <span m="2129080">three,</span> <span m="2129520">four</span> <span m="2130530">integers</span> <span m="2131720">that</span> <span m="2131870">are</span> <span m="2131990">relatively</span> <span m="2132590">prime.</span> <span m="2134250">OK,</span> <span m="2134980">so</span> <span m="2135220">let's</span> <span m="2135510">have</span> <span m="2135790">a</span> <span m="2135890">different</span> <span m="2136370">one.</span> <span m="2136800">Say,</span> <span m="2137220">n</span> <span m="2137510">equals</span> <span m="2137800">15.</span> <span m="2139200">It's</span> <span m="2139240">little</span> <span m="2139390">bit</span> <span m="2139530">different,</span> <span m="2141410">because</span> <span m="2141740">here</span> <span m="2141930">you</span> <span m="2142040">may</span> <span m="2142560">think</span> <span m="2142870">this</span> <span m="2143040">is</span> <span m="2143160">kind</span> <span m="2143330">of</span> <span m="2143400">coincidental</span> <span m="2144170">that</span> <span m="2144540">1,</span> <span m="2145013">5,</span> <span m="2145486">7, and</span> <span m="2145960">11</span> <span m="2146420">are</span> <span m="2146590">actually,</span> <span m="2146940">also,</span> <span m="2147640">primes.</span> <span m="2148870">But</span> <span m="2149070">for</span> <span m="2149250">15</span> <span m="2149870">it</span> <span m="2150010">looks</span> <span m="2150210">a</span> <span m="2150230">little</span> <span m="2150390">bit</span> <span m="2150520">different.</span> <span m="2155300">So</span> <span m="2155480">let's</span> <span m="2155740">write</span> <span m="2156000">out</span> <span m="2156320">all</span> <span m="2158780">the</span> <span m="2158890">numbers.</span> </p>
<p><span m="2161150">Again,</span> <span m="2161700">let's</span> <span m="2161890">have</span> <span m="2162060">a</span> <span m="2162130">look.</span> <span m="2162590">Well,</span> <span m="2162870">one</span> <span m="2163150">is  the</span> <span m="2163220">greatest</span> <span m="2163450">common</span> <span m="2163580">divisor</span> <span m="2164750">equal</span> <span m="2165030">to</span> <span m="2165170">1,</span> <span m="2166060">with</span> <span m="2166230">respect</span> <span m="2166530">to</span> <span m="2166610">15.</span> <span m="2168290">2</span> <span m="2170210">is</span> <span m="2170380">also</span> <span m="2170950">relatively</span> <span m="2171440">prime,</span> <span m="2172420">with</span> <span m="2172540">respect</span> <span m="2172870">to</span> <span m="2172950">15.</span> <span m="2173240">3</span> <span m="2173530">is</span> <span m="2173690">dividing</span> <span m="2174080">15.</span> <span m="2174416">4--</span> <span m="2175680">yeah,</span> <span m="2175920">4</span> <span m="2177230">and</span> <span m="2177460">15</span> <span m="2178080">have</span> <span m="2178280">greatest</span> <span m="2178620">common</span> <span m="2178800">divisor</span> <span m="2179390">equal</span> <span m="2179670">to</span> <span m="2179820">1.</span> <span m="2180200">So</span> <span m="2180380">that's</span> <span m="2180580">relatively</span> <span m="2181120">prime.</span> <span m="2183400">5</span> <span m="2183800">is</span> <span m="2183970">not.</span> <span m="2185200">6</span> <span m="2185500">is</span> <span m="2185680">not.</span> <span m="2185930">7</span> <span m="2186320">is</span> <span m="2186670">relatively</span> <span m="2187150">prime.</span> <span m="2187540">8--</span> <span m="2187750">again,</span> <span m="2188220">this</span> <span m="2188400">is</span> <span m="2188480">only</span> <span m="2188700">divisible</span> <span m="2189480">by</span> <span m="2189700">power</span> <span m="2190090">of</span> <span m="2190240">2,</span> <span m="2191260">and</span> <span m="2191880">this</span> <span m="2192160">has</span> <span m="2192370">no</span> <span m="2193040">power</span> <span m="2193290">of</span> <span m="2193510">2</span> <span m="2193740">in</span> <span m="2193890">it.</span> <span m="2195780">9,</span> <span m="2196275">10</span> <span m="2197450">are--</span> <span m="2198240">this one</span> <span m="2198830">is</span> <span m="2199010">divisible by</span> <span m="2199240">5,</span> <span m="2199770">divisible</span> <span m="2200220">by</span> <span m="2200510">3.</span> <span m="2201750">11</span> <span m="2201940">is,</span> <span m="2202370">again,</span> <span m="2202700">relatively</span> <span m="2203270">prime.</span> <span m="2204520">And</span> <span m="2204620">then</span> <span m="2204750">we</span> <span m="2204890">have</span> <span m="2205350">13</span> <span m="2206010">is</span> <span m="2206170">relatively</span> <span m="2206700">prime</span> <span m="2206990">as</span> <span m="2207130">well.</span> <span m="2208100">And</span> <span m="2208270">14</span> <span m="2208730">as</span> <span m="2208880">well,</span> <span m="2209090">because</span> <span m="2209350">this is</span> <span m="2209590">2</span> <span m="2209750">times</span> <span m="2210050">7,</span> <span m="2210460">and</span> <span m="2210580">this</span> <span m="2210730">is</span> <span m="2210900">3</span> <span m="2211080">times</span> <span m="2211390">5.</span> <span m="2212240">So</span> <span m="2212400">how</span> <span m="2212530">many</span> <span m="2212770">do</span> <span m="2212890">we</span> <span m="2213290">see</span> <span m="2213590">now?</span> <span m="2213880">1,</span> <span m="2214358">2,</span> <span m="2214836">3,</span> <span m="2215314">4,</span> <span m="2215792">5,</span> <span m="2216270">6,</span> <span m="2216748">7,</span> <span m="2217230">8.</span> <span m="2221660">So</span> <span m="2221860">the</span> <span m="2222200">Euler's totient</span> <span m="2222560">function</span> <span m="2222990">evaluated</span> <span m="2223820">in</span> <span m="2224000">15</span> <span m="2224570">is</span> <span m="2224720">actually</span> <span m="2225030">equal</span> <span m="2225210">to</span> <span m="2225340">8.</span> </p>
<p><span m="2225540">Now,</span> <span m="2226810">it</span> <span m="2227050">turns</span> <span m="2227470">out</span> <span m="2227730">that</span> <span m="2228840">this</span> <span m="2229680">function</span> <span m="2230110">has</span> <span m="2230240">really</span> <span m="2230480">nice</span> <span m="2230800">properties,</span> <span m="2232070">and</span> <span m="2232220">you</span> <span m="2232370">can</span> <span m="2233100">easily</span> <span m="2233560">calculate--</span> <span m="2234380">if</span> <span m="2234620">you</span> <span m="2234760">know</span> <span m="2237270">the</span> <span m="2237370">decomposition</span> <span m="2238130">of</span> <span m="2238290">n</span> <span m="2238610">into</span> <span m="2238880">its</span> <span m="2239060">primes,</span> <span m="2239580">and</span> <span m="2239720">powers</span> <span m="2240110">of</span> <span m="2240240">primes--</span> <span m="2241340">you</span> <span m="2241440">can</span> <span m="2241580">easily</span> <span m="2241980">compute</span> <span m="2243450">this</span> <span m="2243670">number,</span> <span m="2245260">phi of</span> <span m="2245640">n.</span> <span m="2248190">Now,</span> <span m="2248310">you</span> <span m="2248430">will</span> <span m="2248550">be</span> <span m="2248660">able</span> <span m="2248820">to</span> <span m="2248930">find</span> <span m="2249240">this</span> <span m="2249550">in</span> <span m="2249750">the</span> <span m="2249840">book.</span> <span m="2250300">You</span> <span m="2250430">should</span> <span m="2250610">read it.</span> <span m="2251160">And</span> <span m="2251500">also,</span> <span m="2251770">problem</span> <span m="2252130">set</span> <span m="2252520">talks</span> <span m="2252810">about</span> <span m="2253130">this.</span> <span m="2255340">But</span> <span m="2255570">for</span> <span m="2255670">now,</span> <span m="2256080">let's</span> <span m="2256270">just</span> <span m="2257640">talk</span> <span m="2257970">about</span> <span m="2258530">this</span> <span m="2258820">is</span> <span m="2259100">an</span> <span m="2259240">abstract</span> <span m="2259700">notion,</span> <span m="2260240">because</span> <span m="2260550">that's</span> <span m="2260730">all</span> <span m="2260950">that</span> <span m="2261050">we will</span> <span m="2261330">use</span> <span m="2261580">in</span> <span m="2261640">this</span> <span m="2261800">lecture.</span> <span m="2263370">But</span> <span m="2263530">you</span> <span m="2263630">will</span> <span m="2263740">have</span> <span m="2263920">a</span> <span m="2263970">few</span> <span m="2264160">exercises</span> <span m="2264940">to</span> <span m="2265090">talk</span> <span m="2265380">about</span> <span m="2265670">computing</span> <span m="2266190">this</span> <span m="2266380">kind</span> <span m="2266580">of</span> <span m="2266650">stuff.</span> </p>
<p><span m="2268170">OK,</span> <span m="2269850">so</span> <span m="2273470">let's</span> <span m="2273690">talk</span> <span m="2273880">about</span> <span m="2274480">Euler's</span> <span m="2275040">totient</span> <span m="2275680">function</span> <span m="2277690">and</span> <span m="2278040">Euler's</span> <span m="2278410">theorem.</span> <span m="2279140">So</span> <span m="2280250">let</span> <span m="2280460">me</span> <span m="2281030">use</span> <span m="2283570">this</span> <span m="2283950">blackboard.</span> <span m="2294260">Now,</span> <span m="2294370">this</span> <span m="2294520">is</span> <span m="2294630">really</span> <span m="2294800">an</span> <span m="2294890">exciting</span> <span m="2295670">theorem.</span> <span m="2297800">And</span> <span m="2297990">it's</span> <span m="2298140">a</span> <span m="2298190">little</span> <span m="2298340">bit</span> <span m="2298500">hard</span> <span m="2298750">to</span> <span m="2298850">prove.</span> <span m="2300110">So</span> <span m="2300520">why we'll need</span> <span m="2300900">a</span> <span m="2301510">little</span> <span m="2301700">bit</span> <span m="2301850">more</span> <span m="2302040">time</span> <span m="2302270">to</span> <span m="2302400">do</span> <span m="2302580">this.</span> <span m="2304810">Euler's theorem</span> <span m="2305140">says</span> <span m="2305840">the</span> <span m="2305900">following.</span> <span m="2307430">If</span> <span m="2307970">the</span> <span m="2308100">GCD</span> <span m="2309570">of</span> <span m="2310350">n</span> <span m="2310620">and</span> <span m="2310920">k</span> <span m="2312500">is</span> <span m="2312670">equal</span> <span m="2312950">to</span> <span m="2313160">1,</span> <span m="2314750">then</span> <span m="2318820">k</span> <span m="2319060">to</span> <span m="2319210">the</span> <span m="2319350">power</span> <span m="2320900">[INAUDIBLE]</span> <span m="2321270">the</span> <span m="2321580">Euler's</span> <span m="2321890">totient</span> <span m="2322200">function</span> <span m="2322520">evaluated</span> <span m="2323090">in</span> <span m="2323190">n</span> <span m="2323590">is</span> <span m="2323890">actually</span> <span m="2324380">congruent</span> <span m="2324960">to</span> <span m="2325130">1</span> <span m="2325760">modulo</span> <span m="2327970">n.</span> <span m="2330280">So</span> <span m="2330430">this</span> <span m="2330620">is</span> <span m="2330740">what</span> <span m="2330870">we're</span> <span m="2331000">going</span> <span m="2331200">to</span> <span m="2331320">prove</span> <span m="2331640">here.</span> </p>
<p><span m="2332340">So</span> <span m="2332430">why</span> <span m="2332600">is this</span> <span m="2332800">so</span> <span m="2332990">interesting?</span> <span m="2334920">Well,</span> <span m="2335200">we'll</span> <span m="2335820">talk</span> <span m="2336100">about</span> <span m="2336350">an</span> <span m="2336470">application</span> <span m="2337670">which</span> <span m="2337760">is</span> <span m="2337920">a</span> <span m="2338210">direct</span> <span m="2338560">consequence</span> <span m="2339130">of</span> <span m="2339240">this</span> <span m="2339470">theorem,</span> <span m="2339770">which</span> <span m="2339980">we'll call</span> <span m="2340340">Fermat's</span> <span m="2341060">little</span> <span m="2341320">theorem.</span> <span m="2342550">And</span> <span m="2343040">that,</span> <span m="2343250">in</span> <span m="2343430">turn,</span> <span m="2344200">we will</span> <span m="2344460">use</span> <span m="2345070">to</span> <span m="2345460">explain</span> <span m="2345840">the</span> <span m="2345960">RSA</span> <span m="2346520">algorithm,</span> <span m="2347430">and</span> <span m="2347910">show</span> <span m="2348230">how</span> <span m="2348460">the</span> <span m="2348570">decryption</span> <span m="2348970">works,</span> <span m="2350230">and</span> <span m="2350330">so</span> <span m="2350520">on.</span> <span m="2351480">So</span> <span m="2351930">how</span> <span m="2352090">can</span> <span m="2352270">we prove</span> <span m="2352650">this?</span> <span m="2361450">It</span> <span m="2361590">will</span> <span m="2361690">start</span> <span m="2362460">with</span> <span m="2363570">a</span> <span m="2363670">first</span> <span m="2364080">lemma,</span> <span m="2377570">and</span> <span m="2377710">then</span> <span m="2377850">we're</span> <span m="2377930">going</span> <span m="2378210">to do</span> <span m="2378320">a</span> <span m="2378380">few</span> <span m="2379730">tricks--</span> <span m="2380260">mathematical</span> <span m="2380880">tricks,</span> <span m="2381310">you</span> <span m="2381440">will</span> <span m="2381530">see</span> <span m="2381810">it.</span> <span m="2382510">So</span> <span m="2382740">the</span> <span m="2382850">first</span> <span m="2383200">lemma</span> <span m="2384320">is</span> <span m="2384970">that</span> <span m="2386640">if</span> <span m="2388500">I</span> <span m="2388670">know</span> <span m="2388960">that</span> <span m="2389160">the</span> <span m="2389210">GCD--</span> <span m="2390470">which</span> <span m="2390700">is</span> <span m="2390820">what we</span> <span m="2391100">are</span> <span m="2391340">assuming,</span> <span m="2392120">the</span> <span m="2392200">statement</span> <span m="2392720">of</span> <span m="2392990">the</span> <span m="2393230">theorum--</span> <span m="2393960">if</span> <span m="2394140">I</span> <span m="2394200">know</span> <span m="2394460">that</span> <span m="2394720">the</span> <span m="2394870">GCD</span> <span m="2395320">of n and</span> <span m="2395810">k</span> <span m="2396100">equals</span> <span m="2396440">1,</span> <span m="2397900">then</span> <span m="2400350">I</span> <span m="2400510">know</span> <span m="2400810">that</span> <span m="2401900">and</span> <span m="2402810">a</span> <span m="2403180">times</span> <span m="2403620">k--</span> <span m="2404480">if</span> <span m="2404720">a</span> <span m="2404870">times</span> <span m="2405210">k</span> <span m="2405430">is</span> <span m="2405700">congruent</span> <span m="2406300">to</span> <span m="2407410">b</span> <span m="2407990">times</span> <span m="2408480">k</span> <span m="2410450">modulo</span> <span m="2410910">n,</span> <span m="2412720">then</span> <span m="2412880">this</span> <span m="2413080">applies</span> <span m="2414350">that</span> <span m="2414620">a</span> <span m="2414890">is</span> <span m="2415130">congruent</span> <span m="2415700">to</span> <span m="2415910">b</span> <span m="2416740">modulo</span> <span m="2417240">n.</span> <span m="2417890">All</span> <span m="2418050">this</span> <span m="2418230">seems</span> <span m="2418470">to</span> <span m="2418580">be</span> <span m="2419500">kind</span> <span m="2419670">of a</span> <span m="2419740">straightforward</span> <span m="2420350">lemma.</span> <span m="2421435">I will</span> <span m="2421690">only</span> <span m="2422060">talk</span> <span m="2422320">about</span> <span m="2422610">its</span> <span m="2422790">proof.</span> </p>
<p><span m="2424180">So</span> <span m="2424390">how</span> <span m="2424530">do</span> <span m="2424620">we</span> <span m="2424730">do</span> <span m="2424960">it?</span> <span m="2425550">Well,</span> <span m="2426020">first</span> <span m="2426330">of all,</span> <span m="2426630">I</span> <span m="2426680">know that</span> <span m="2427020">the</span> <span m="2427120">GCD</span> <span m="2427680">of</span> <span m="2427800">n</span> <span m="2427990">and</span> <span m="2428140">k</span> <span m="2428360">equals</span> <span m="2428750">1.</span> <span m="2429790">So</span> <span m="2430580">that</span> <span m="2430760">means</span> <span m="2431260">that</span> <span m="2432930">I</span> <span m="2433100">can</span> <span m="2433340">create</span> <span m="2434020">a</span> <span m="2434490">multiplicative</span> <span m="2435680">inverse,</span> <span m="2436440">because</span> <span m="2436830">I</span> <span m="2436880">know</span> <span m="2437740">that</span> <span m="2437880">there's</span> <span m="2438110">such</span> <span m="2438380">a</span> <span m="2438400">linear</span> <span m="2438710">combination</span> <span m="2440400">that</span> <span m="2441970">will</span> <span m="2442650">ends</span> <span m="2442870">up</span> <span m="2443470">to</span> <span m="2443710">1.</span> <span m="2446240">So</span> <span m="2447950">I</span> <span m="2448200">have</span> <span m="2448550">the</span> <span m="2448660">multiplicative</span> <span m="2449300">inverse.</span> <span m="2450140">I</span> <span m="2450240">multiply</span> <span m="2451250">both</span> <span m="2451550">sides</span> <span m="2452200">with</span> <span m="2452460">this,</span> <span m="2453920">and</span> <span m="2454150">then</span> <span m="2454440">I</span> <span m="2454510">will</span> <span m="2454650">end</span> <span m="2454870">up</span> <span m="2455020">to,</span> <span m="2455330">a</span> <span m="2455670">is</span> <span m="2455840">congruent</span> <span m="2456190">to</span> <span m="2456320">b</span> <span m="2456510">modulo</span> <span m="2456890">n.</span> <span m="2457230">And</span> <span m="2457390">actually,</span> <span m="2458050">you</span> <span m="2458170">can</span> <span m="2458350">use</span> <span m="2458530">some</span> <span m="2458710">of</span> <span m="2458830">the</span> <span m="2458920">facts</span> <span m="2459300">on</span> <span m="2459410">your</span> <span m="2459500">sheet</span> <span m="2460450">to</span> <span m="2461380">prove</span> <span m="2461780">this.</span> <span m="2462670">And</span> <span m="2463230">in</span> <span m="2463420">the</span> <span m="2463520">problem</span> <span m="2463860">set,</span> <span m="2464300">you</span> <span m="2464980">probably</span> <span m="2465280">have</span> <span m="2465440">seen</span> <span m="2465790">that</span> <span m="2465950">there</span> <span m="2466390">are</span> <span m="2466770">a</span> <span m="2466840">number</span> <span m="2467200">of</span> <span m="2467790">problems</span> <span m="2469020">related</span> <span m="2469450">to</span> <span m="2469590">this.</span> <span m="2473080">So you will</span> <span m="2473850">recognize</span> <span m="2474390">this,</span> <span m="2474570">and prove</span> <span m="2474920">a</span> <span m="2474970">few</span> <span m="2475180">of</span> <span m="2475250">these</span> <span m="2475460">things</span> <span m="2475610">yourself.</span> </p>
<p><span m="2477410">OK,</span> <span m="2482070">so</span> <span m="2482280">this</span> <span m="2482560">is--</span> <span m="2482960">so</span> <span m="2483445">let</span> <span m="2483930">me</span> <span m="2484090">see.</span> <span m="2489380">So</span> <span m="2489590">let</span> <span m="2489670">me</span> <span m="2489800">see</span> <span m="2490440">what</span> <span m="2490810">we</span> <span m="2490930">have</span> <span m="2491270">done</span> <span m="2491510">here.</span> <span m="2494610">Actually,</span> <span m="2495450">I</span> <span m="2495610">noticed</span> <span m="2496170">that</span> <span m="2496320">I've</span> <span m="2496620">missed</span> <span m="2497090">one</span> <span m="2497330">statement</span> <span m="2497680">that</span> <span m="2498030">I</span> <span m="2498070">would</span> <span m="2498240">like</span> <span m="2498430">to</span> <span m="2498500">explicitly</span> <span m="2499200">mention.</span> <span m="2500600">I</span> <span m="2500700">mean,</span> <span m="2500880">I've</span> <span m="2501020">used</span> <span m="2501170">it</span> <span m="2501390">a</span> <span m="2501440">few</span> <span m="2501760">times.</span> <span m="2503510">Let</span> <span m="2503660">me</span> <span m="2503750">do</span> <span m="2503950">that</span> <span m="2504170">first.</span> <span m="2505740">Which</span> <span m="2505880">is</span> <span m="2506070">that,</span> <span m="2509150">we</span> <span m="2509190">know</span> <span m="2509450">that</span> <span m="2510820">if</span> <span m="2511180">the</span> <span m="2511290">GCD</span> <span m="2512880">of</span> <span m="2513190">n</span> <span m="2513485">and</span> <span m="2513780">k</span> <span m="2514200">equals</span> <span m="2514580">1,</span> <span m="2516740">then--</span> <span m="2519323">this</span> <span m="2519736">is if,</span> <span m="2520150">and</span> <span m="2520280">only</span> <span m="2520590">if,</span> <span m="2520780">the</span> <span m="2520900">case--</span> <span m="2521720">if</span> <span m="2522040">k</span> <span m="2522460">has</span> <span m="2523000">a</span> <span m="2524030">multiplicative</span> <span m="2524970">inverse--</span> <span m="2527000">I've</span> <span m="2527500">not yet</span> <span m="2528150">explicitly</span> <span m="2529220">stated</span> <span m="2529780">it--</span> <span m="2533480">and</span> <span m="2533730">we</span> <span m="2533870">can</span> <span m="2534620">easily</span> <span m="2535040">see</span> <span m="2535410">this--</span> <span m="2536400">let</span> <span m="2536520">me</span> <span m="2536610">just</span> <span m="2536860">give</span> <span m="2537040">a</span> <span m="2537100">quick</span> <span m="2537390">proof</span> <span m="2539850">to</span> <span m="2539970">show</span> <span m="2540310">how</span> <span m="2540490">this</span> <span m="2540690">works.</span> <span m="2543960">Well,</span> <span m="2544180">if</span> <span m="2544310">the</span> <span m="2544400">GCD</span> <span m="2545460">is</span> <span m="2545650">equal</span> <span m="2546000">to</span> <span m="2546240">1,</span> <span m="2550335">then</span> <span m="2550790">we</span> <span m="2551050">use</span> <span m="2551570">the</span> <span m="2551650">statement</span> <span m="2552180">up</span> <span m="2552360">there.</span> <span m="2554090">So</span> <span m="2554310">this</span> <span m="2554580">is</span> <span m="2555910">if,</span> <span m="2556070">and</span> <span m="2556200">only</span> <span m="2556510">if,</span> <span m="2557360">there</span> <span m="2557530">exists</span> <span m="2558670">a</span> <span m="2558700">linear</span> <span m="2558980">combination.</span> <span m="2560470">So</span> <span m="2560830">an s</span> <span m="2561310">and a t,</span> <span m="2561790">such</span> <span m="2562150">that</span> <span m="2562440">n</span> <span m="2562960">times</span> <span m="2563400">s</span> <span m="2563790">plus</span> <span m="2565130">k</span> <span m="2565410">times</span> <span m="2565890">t</span> <span m="2566250">equals</span> <span m="2566600">1.</span> <span m="2568170">Well,</span> <span m="2568470">then</span> <span m="2568630">I</span> <span m="2568770">also</span> <span m="2569040">know</span> <span m="2570090">that</span> <span m="2570400">there</span> <span m="2570620">exists</span> <span m="2572290">a</span> <span m="2572450">t</span> <span m="2573310">such</span> <span m="2573740">that,</span> <span m="2576450">actually,</span> <span m="2577150">the</span> <span m="2577250">difference</span> <span m="2578560">between</span> <span m="2579300">1</span> <span m="2579730">and</span> <span m="2579920">k</span> <span m="2580120">times</span> <span m="2580520">t</span> <span m="2581280">is</span> <span m="2581450">divisible</span> <span m="2581930">by</span> <span m="2582110">n.</span> </p>
<p><span m="2583740">So</span> <span m="2584180">n</span> <span m="2584540">divides</span> <span m="2585740">the</span> <span m="2585860">difference</span> <span m="2587200">of</span> <span m="2587520">k</span> <span m="2587740">times</span> <span m="2588120">t</span> <span m="2588820">minus</span> <span m="2589730">1.</span> <span m="2590716">So</span> <span m="2591210">why</span> <span m="2591400">is</span> <span m="2591550">that?</span> <span m="2592080">Well,</span> <span m="2592410">if</span> <span m="2592600">I</span> <span m="2592650">look</span> <span m="2592870">at</span> <span m="2592950">the</span> <span m="2593050">difference</span> <span m="2593240">between</span> <span m="2593670">k</span> <span m="2594240">times</span> <span m="2594570">t</span> <span m="2594780">and</span> <span m="2594950">1,</span> <span m="2595440">the</span> <span m="2595560">difference</span> <span m="2596010">is</span> <span m="2596180">n</span> <span m="2596390">times</span> <span m="2596690">s.</span> <span m="2597580">And</span> <span m="2597770">n</span> <span m="2597910">times</span> <span m="2598190">s</span> <span m="2598505">is</span> <span m="2598820">divisible</span> <span m="2599300">by</span> <span m="2599470">n.</span> <span m="2600640">So</span> <span m="2600820">now,</span> <span m="2601050">by the</span> <span m="2601200">definition</span> <span m="2601970">of</span> <span m="2602100">congruence,</span> <span m="2604480">I</span> <span m="2604580">just</span> <span m="2604840">apply</span> <span m="2605080">the</span> <span m="2605180">definition</span> <span m="2605770">over</span> <span m="2606030">here.</span> <span m="2606710">We</span> <span m="2606900">have written</span> <span m="2607200">it</span> <span m="2607340">out</span> <span m="2607560">here.</span> <span m="2608390">We</span> <span m="2608490">can</span> <span m="2608670">say</span> <span m="2609220">that</span> <span m="2611020">k</span> <span m="2611270">times</span> <span m="2611760">t</span> <span m="2612070">is</span> <span m="2612270">congruent</span> <span m="2612830">to</span> <span m="2613000">1</span> <span m="2613470">modulo</span> <span m="2615430">n.</span> <span m="2617470">And</span> <span m="2618480">this</span> <span m="2618800">is</span> <span m="2618930">the</span> <span m="2619010">definition</span> <span m="2619720">of</span> <span m="2620090">the</span> <span m="2620210">multiplication</span> <span m="2620930">inverse.</span> <span m="2621970">So</span> <span m="2622530">we</span> <span m="2622690">have</span> <span m="2623170">essentially</span> <span m="2623750">shown</span> <span m="2624690">that</span> <span m="2625450">if</span> <span m="2625630">the</span> <span m="2625710">greatest</span> <span m="2626000">common</span> <span m="2626260">divisors</span> <span m="2626690">in</span> <span m="2626800">any</span> <span m="2627050">case</span> <span m="2627400">equal</span> <span m="2627580">to</span> <span m="2627710">1,</span> <span m="2628650">then</span> <span m="2628830">it</span> <span m="2628920">has</span> <span m="2629200">a</span> <span m="2629270">multiplicative</span> <span m="2630030">inverse.</span> </p>
<p><span m="2632380">OK,</span> <span m="2632750">we</span> <span m="2632870">have</span> <span m="2633160">been</span> <span m="2633490">using</span> <span m="2633930">this</span> <span m="2635190">property</span> <span m="2637990">over</span> <span m="2638300">here</span> <span m="2640000">because</span> <span m="2640780">we</span> <span m="2641270">assume</span> <span m="2641710">that</span> <span m="2641950">the greatest</span> <span m="2642380">common</span> <span m="2642480">divisor</span> <span m="2642735">is</span> <span m="2642990">equal</span> <span m="2643240">to</span> <span m="2643400">1.</span> <span m="2643860">So</span> <span m="2644070">we</span> <span m="2644200">now</span> <span m="2644490">know</span> <span m="2645380">that</span> <span m="2645520">there</span> <span m="2645650">exists</span> <span m="2646030">a</span> <span m="2646080">multiplicative</span> <span m="2646860">inverse</span> <span m="2647450">of</span> <span m="2647680">k.</span> <span m="2648720">We</span> <span m="2648830">use</span> <span m="2649160">that</span> <span m="2649350">one</span> <span m="2649650">to</span> <span m="2650240">multiply</span> <span m="2652080">away,</span> <span m="2652440">essentially,</span> <span m="2653440">the</span> <span m="2653630">k</span> <span m="2654100">out</span> <span m="2654310">of</span> <span m="2654480">this</span> <span m="2654680">equation,</span> <span m="2655410">and</span> <span m="2655600">get</span> <span m="2655870">a</span> <span m="2656070">is</span> <span m="2656290">congruent</span> <span m="2656710">to</span> <span m="2656830">b</span> <span m="2657050">modulo</span> <span m="2657530">n.</span> </p>
<p><span m="2659320">Also</span> <span m="2659560">note</span> <span m="2659850">that</span> <span m="2660070">we</span> <span m="2660190">use</span> <span m="2660490">the</span> <span m="2660630">property</span> <span m="2661180">over</span> <span m="2661450">here.</span> <span m="2664160">We</span> <span m="2664290">said</span> <span m="2666060">that</span> <span m="2666360">we</span> <span m="2668210">wanted</span> <span m="2668380">to</span> <span m="2668580">compute,</span> <span m="2670570">what was it</span> <span m="2671040">again?</span> <span m="2672520">Over</span> <span m="2672930">here--</span> <span m="2675130">we</span> <span m="2675270">started</span> <span m="2675710">off</span> <span m="2675940">with</span> <span m="2676090">the</span> <span m="2676160">GCD</span> <span m="2676720">of</span> <span m="2676930">m</span> <span m="2677110">and</span> <span m="2677280">p</span> <span m="2677480">to</span> <span m="2677580">be</span> <span m="2677740">equal</span> <span m="2677960">to</span> <span m="2678110">1,</span> <span m="2678620">and</span> <span m="2678880">I</span> <span m="2678940">know</span> <span m="2679220">p.</span> <span m="2680280">And</span> <span m="2680430">now</span> <span m="2680570">I</span> <span m="2680650">can</span> <span m="2680840">compute</span> <span m="2681810">the</span> <span m="2681910">multiplicative</span> <span m="2682780">inverse</span> <span m="2683280">of</span> <span m="2683470">m.</span> <span m="2683920">And I</span> <span m="2684190">should have</span> <span m="2684460">said</span> <span m="2685410">why it</span> <span m="2685793">exists.</span> <span m="2686930">And</span> <span m="2687100">it exists</span> <span m="2688120">because</span> <span m="2688480">of</span> <span m="2688630">that</span> <span m="2689440">lemma</span> <span m="2689950">that</span> <span m="2690690">I</span> <span m="2690760">just</span> <span m="2691030">mentioned</span> <span m="2691580">up</span> <span m="2691920">here.</span> </p>
<p><span m="2693140">OK,</span> <span m="2693400">so</span> <span m="2693530">now</span> <span m="2693670">let's</span> <span m="2693900">go</span> <span m="2694020">back</span> <span m="2694240">to</span> <span m="2694490">Euler's</span> <span m="2695140">theorem.</span> <span m="2698030">This</span> <span m="2698260">first</span> <span m="2698570">lemma</span> <span m="2698980">we</span> <span m="2699360">are going to</span> <span m="2699480">use</span> <span m="2699800">to</span> <span m="2700040">prove a</span> <span m="2700100">second</span> <span m="2700480">lemma,</span> <span m="2701070">and</span> <span m="2701270">that</span> <span m="2701370">second</span> <span m="2701760">lemma</span> <span m="2702220">we</span> <span m="2702450">can</span> <span m="2702590">finally</span> <span m="2703030">use</span> <span m="2703510">to</span> <span m="2703970">prove</span> <span m="2704340">the</span> <span m="2704410">theorem.</span> <span m="2707610">All</span> <span m="2707680">right,</span> <span m="2709940">so</span> <span m="2710190">this</span> <span m="2710440">lemma</span> <span m="2710880">I</span> <span m="2710960">will</span> <span m="2711120">put</span> <span m="2711300">on</span> <span m="2711410">a</span> <span m="2711470">separate</span> <span m="2712500">board,</span> <span m="2715570">because</span> <span m="2716120">it</span> <span m="2716230">contains</span> <span m="2716740">quite</span> <span m="2716970">a</span> <span m="2717030">number</span> <span m="2717320">of</span> <span m="2717400">steps</span> <span m="2717820">to</span> <span m="2717880">prove.</span> <span m="2726400">So</span> <span m="2726660">the</span> <span m="2726760">lemma</span> <span m="2727020">states</span> <span m="2727760">that,</span> <span m="2729390">if</span> <span m="2729760">we</span> <span m="2730510">suppose</span> <span m="2732160">that</span> <span m="2735240">the</span> <span m="2735390">GCD</span> <span m="2737320">of n</span> <span m="2737590">and</span> <span m="2738140">k</span> <span m="2738430">equals</span> <span m="2738810">1--</span> <span m="2739310">so</span> <span m="2739480">it's</span> <span m="2739610">the</span> <span m="2739700">same</span> <span m="2740260">assumptions</span> <span m="2740570">as</span> <span m="2740880">before--</span> <span m="2742920">if</span> <span m="2743220">it</span> <span m="2744090">lets</span> <span m="2745760">k1</span> <span m="2747440">all</span> <span m="2747650">the</span> <span m="2747730">way</span> <span m="2747870">up</span> <span m="2748180">to</span> <span m="2748610">k r</span> <span m="2749690">to</span> <span m="2749830">be</span> <span m="2750290">those</span> <span m="2750570">integers</span> <span m="2751290">in</span> <span m="2752500">the</span> <span m="2752640">range</span> <span m="2753580">1,</span> <span m="2754450">2,</span> <span m="2755020">3,</span> <span m="2755580">and</span> <span m="2755730">so</span> <span m="2755950">on,</span> <span m="2756290">to</span> <span m="2757020">n</span> <span m="2757210">minus</span> <span m="2757630">1,</span> <span m="2759970">that are</span> <span m="2760250">relatively</span> <span m="2760840">prime--</span> <span m="2762580">so</span> <span m="2762840">these</span> <span m="2763120">denote</span> <span m="2765000">the</span> <span m="2765150">integers</span> <span m="2766200">relatively</span> <span m="2766850">prime</span> <span m="2768390">to</span> <span m="2769570">n--</span> <span m="2775470">then</span> <span m="2775640">we</span> <span m="2776120">can</span> <span m="2777190">prove</span> <span m="2777460">a</span> <span m="2777640">very</span> <span m="2777860">interesting</span> <span m="2778280">property.</span> </p>
<p><span m="2781270">Now,</span> <span m="2781470">notice</span> <span m="2781740">by</span> <span m="2781900">the</span> <span m="2782000">way,</span> <span m="2782620">that</span> <span m="2783270">r</span> <span m="2783650">in</span> <span m="2783780">here</span> <span m="2784690">is</span> <span m="2784880">equal</span> <span m="2785700">to</span> <span m="2785820">this</span> <span m="2786000">value</span> <span m="2786870">of</span> <span m="2787380">the</span> <span m="2787650">Euler's</span> <span m="2787940">totient</span> <span m="2788390">function</span> <span m="2788780">evaluated</span> <span m="2789060">in</span> <span m="2789340">n.</span> <span m="2790380">Because</span> <span m="2790860">this</span> <span m="2791120">counts</span> <span m="2791550">the</span> <span m="2791690">total</span> <span m="2792050">number</span> <span m="2793080">of</span> <span m="2795130">numbers</span> <span m="2795500">that</span> <span m="2795570">are</span> <span m="2795680">relatively</span> <span m="2797600">prime</span> <span m="2797900">with</span> <span m="2798050">respect</span> <span m="2798380">to</span> <span m="2798500">n.</span> <span m="2800390">So</span> <span m="2800570">now</span> <span m="2800770">we</span> <span m="2800890">can</span> <span m="2801040">prove</span> <span m="2801310">something</span> <span m="2801640">really</span> <span m="2801830">spectacular.</span> <span m="2804200">We</span> <span m="2804430">can</span> <span m="2804610">show</span> <span m="2805870">that</span> <span m="2806860">the</span> <span m="2807090">set</span> <span m="2807700">that</span> <span m="2807880">contains</span> <span m="2808830">all</span> <span m="2809160">of</span> <span m="2809240">these</span> <span m="2809500">remainders--</span> <span m="2810700">the</span> <span m="2810790">remainder</span> <span m="2811270">of</span> <span m="2811880">k 1</span> <span m="2812270">times</span> <span m="2812720">k,</span> <span m="2814350">after</span> <span m="2815110">dividing</span> <span m="2815650">out</span> <span m="2815790">this</span> <span m="2815950">many</span> <span m="2816220">multiples</span> <span m="2816820">of</span> <span m="2816990">n</span> <span m="2817170">as</span> <span m="2817300">possible,</span> <span m="2819940">all</span> <span m="2820230">the</span> <span m="2820410">way</span> <span m="2820540">to</span> <span m="2820990">the</span> <span m="2821080">remainder</span> <span m="2822330">off</span> <span m="2823690">k</span> <span m="2824060">r</span> <span m="2824800">times</span> <span m="2825400">k,</span> <span m="2826840">after</span> <span m="2826920">dividing</span> <span m="2827390">out</span> <span m="2827810">as</span> <span m="2827970">many</span> <span m="2828170">multiples</span> <span m="2828630">of</span> <span m="2828790">n</span> <span m="2829830">as</span> <span m="2830060">possible,</span> <span m="2832590">this</span> <span m="2832880">set</span> <span m="2833170">is</span> <span m="2833330">actually</span> <span m="2833700">equal</span> <span m="2834870">to</span> <span m="2835010">the</span> <span m="2835130">set</span> <span m="2835490">k 1</span> <span m="2836430">up</span> <span m="2836590">to</span> <span m="2836790">k</span> <span m="2837255">r.</span> <span m="2838810">So</span> <span m="2839010">this</span> <span m="2839210">is</span> <span m="2839320">what</span> <span m="2839470">we're</span> <span m="2839560">going</span> <span m="2839780">to</span> <span m="2839910">prove.</span> <span m="2840910">And</span> <span m="2841040">we'll</span> <span m="2841160">do</span> <span m="2841270">it</span> <span m="2841390">in</span> <span m="2841500">two</span> <span m="2841690">steps.</span> </p>
<p><span m="2843280">We</span> <span m="2843440">first</span> <span m="2843770">show</span> <span m="2845590">that</span> <span m="2845890">this</span> <span m="2846180">set</span> <span m="2847580">has</span> <span m="2848280">exactly</span> <span m="2848890">r</span> <span m="2849170">numbers.</span> <span m="2849630">So</span> <span m="2849870">the</span> <span m="2850330">cardinality</span> <span m="2850990">of</span> <span m="2851100">that</span> <span m="2851280">set</span> <span m="2851580">is</span> <span m="2851780">equal</span> <span m="2851990">to</span> <span m="2852200">r.</span> <span m="2852570">So</span> <span m="2852730">that</span> <span m="2852980">will</span> <span m="2853230">be</span> <span m="2853410">our</span> <span m="2853610">first</span> <span m="2853950">step</span> <span m="2854160">in</span> <span m="2854270">the</span> <span m="2854350">proof.</span> <span m="2856150">And</span> <span m="2856630">over</span> <span m="2856960">here</span> <span m="2857270">we</span> <span m="2857430">will</span> <span m="2857570">show</span> <span m="2858580">that</span> <span m="2859280">every</span> <span m="2859420">remainder</span> <span m="2860520">is</span> <span m="2860780">actually</span> <span m="2862400">relatively</span> <span m="2863110">prime</span> <span m="2863690">to</span> <span m="2863930">n,</span> <span m="2864750">so</span> <span m="2864970">it</span> <span m="2865080">must</span> <span m="2865300">be</span> <span m="2865460">part</span> <span m="2865780">of</span> <span m="2865920">this</span> <span m="2866150">set.</span> <span m="2866420">So</span> <span m="2866540">we</span> <span m="2866660">will</span> <span m="2867090">show</span> <span m="2867490">that</span> <span m="2867690">this</span> <span m="2867870">is</span> <span m="2868000">a</span> <span m="2868050">subset</span> <span m="2868550">of</span> <span m="2868650">this</span> <span m="2868860">set</span> <span m="2869580">in</span> <span m="2869730">a</span> <span m="2869790">second</span> <span m="2870290">part</span> <span m="2870500">of</span> <span m="2870610">the</span> <span m="2870720">proof.</span> <span m="2871770">And</span> <span m="2871920">combining</span> <span m="2872390">those</span> <span m="2872690">two,</span> <span m="2873110">we</span> <span m="2873340">are</span> <span m="2873440">able</span> <span m="2874150">to</span> <span m="2874300">prove</span> <span m="2874680">equality.</span> <span m="2875450">Why's</span> <span m="2875780">that?</span> <span m="2876435">Well</span> <span m="2876690">I</span> <span m="2876870">have</span> <span m="2877240">r</span> <span m="2877690">distinct</span> <span m="2878910">elements</span> <span m="2879420">in</span> <span m="2879510">this</span> <span m="2879770">set,</span> <span m="2880680">I have</span> <span m="2880970">r</span> <span m="2881250">distinct</span> <span m="2881720">elements</span> <span m="2882180">in</span> <span m="2882320">this</span> <span m="2882560">set,</span> <span m="2883850">this</span> <span m="2884090">one</span> <span m="2884290">is</span> <span m="2884410">a</span> <span m="2884460">subset</span> <span m="2884920">of</span> <span m="2885060">this.</span> <span m="2885450">So</span> <span m="2885640">that</span> <span m="2885740">can</span> <span m="2885900">only</span> <span m="2886160">happen</span> <span m="2886500">if</span> <span m="2886620">they</span> <span m="2886760">are</span> <span m="2886900">equal.</span> </p>
<p><span m="2888890">So</span> <span m="2889140">this is</span> <span m="2891120">the</span> <span m="2891220">method</span> <span m="2891650">for</span> <span m="2892370">the</span> <span m="2892460">proof.</span> <span m="2896030">I</span> <span m="2896130">should--</span> <span m="2909200">so</span> <span m="2909410">we'll</span> <span m="2909590">start</span> <span m="2909990">with</span> <span m="2910300">the</span> <span m="2910500">first</span> <span m="2910930">part.</span> <span m="2914180">And</span> <span m="2914870">the</span> <span m="2915000">way</span> <span m="2915140">to</span> <span m="2915310">do</span> <span m="2915550">that</span> <span m="2915970">is</span> <span m="2916280">to</span> <span m="2919010">see</span> <span m="2919380">whether</span> <span m="2919650">it</span> <span m="2919770">is</span> <span m="2919930">possible</span> <span m="2920470">that</span> <span m="2923680">any</span> <span m="2925270">two</span> <span m="2925840">remainders</span> <span m="2926210">in</span> <span m="2926470">that</span> <span m="2926640">set,</span> <span m="2927600">can</span> <span m="2927760">they</span> <span m="2927840">be</span> <span m="2928000">equal</span> <span m="2928250">to</span> <span m="2928370">one</span> <span m="2928530">another?</span> <span m="2928860">We will</span> <span m="2929060">show</span> <span m="2929300">that</span> <span m="2929370">that's</span> <span m="2929590">not</span> <span m="2929770">possible.</span> <span m="2930870">So</span> <span m="2931210">if</span> <span m="2931360">it's</span> <span m="2931540">not</span> <span m="2931690">possible,</span> <span m="2932160">then</span> <span m="2932610">all</span> <span m="2932980">these</span> <span m="2934000">remainders</span> <span m="2934490">must</span> <span m="2934760">be</span> <span m="2934870">different.</span> <span m="2935470">And</span> <span m="2935630">we have</span> <span m="2936010">exactly</span> <span m="2936300">r of those.</span> <span m="2937790">So</span> <span m="2938040">let's</span> <span m="2938290">do</span> <span m="2938450">this.</span> </p>
<p><span m="2939650">So</span> <span m="2939840">the</span> <span m="2939950">proof</span> <span m="2940480">for</span> <span m="2941300">1</span> <span m="2943290">is</span> <span m="2943520">as</span> <span m="2943680">follows.</span> <span m="2944690">Let's</span> <span m="2944940">assume</span> <span m="2945620">that we</span> <span m="2945830">he</span> <span m="2945950">have</span> <span m="2946500">to</span> <span m="2946730">remainders.</span> <span m="2947550">Say,</span> <span m="2947850">k</span> <span m="2948260">i</span> <span m="2948530">times</span> <span m="2949040">k,</span> <span m="2952070">and</span> <span m="2953005">a</span> <span m="2953290">remainder</span> <span m="2955240">k</span> <span m="2955740">j</span> <span m="2956080">times</span> <span m="2956540">k,</span> <span m="2957330">after</span> <span m="2957440">dividing</span> <span m="2957940">out as</span> <span m="2958200">many</span> <span m="2958370">multiples</span> <span m="2958890">of</span> <span m="2959040">n.</span> <span m="2959210">And</span> <span m="2959740">supposed</span> <span m="2960110">that</span> <span m="2960170">they are</span> <span m="2960410">equal</span> <span m="2960710">to</span> <span m="2960840">one</span> <span m="2961000">another.</span> <span m="2962000">We're</span> <span m="2962080">going</span> <span m="2962310">to</span> <span m="2962410">show</span> <span m="2963500">that</span> <span m="2964310">this</span> <span m="2964510">can</span> <span m="2964740">only</span> <span m="2965120">happen</span> <span m="2965740">if</span> <span m="2966000">k</span> <span m="2966260">i</span> <span m="2966720">is</span> <span m="2966980">equal</span> <span m="2967310">to</span> <span m="2967480">k</span> <span m="2967810">j.</span> <span m="2969120">And</span> <span m="2969300">if</span> <span m="2969420">you</span> <span m="2970180">can</span> <span m="2970380">see</span> <span m="2970650">that,</span> <span m="2971710">well</span> <span m="2971920">then</span> <span m="2972090">we</span> <span m="2972180">know that</span> <span m="2972560">all</span> <span m="2972820">these</span> <span m="2973010">different</span> <span m="2973360">remainders</span> <span m="2973770">are</span> <span m="2973880">actually</span> <span m="2974200">different</span> <span m="2974550">from</span> <span m="2974730">one</span> <span m="2974910">another.</span> <span m="2975500">And</span> <span m="2975640">if</span> <span m="2975750">they're</span> <span m="2975950">all</span> <span m="2976160">different</span> <span m="2976480">from</span> <span m="2976650">one</span> <span m="2976810">another,</span> <span m="2977880">then</span> <span m="2978060">we</span> <span m="2978150">must</span> <span m="2978470">have</span> <span m="2978620">exactly</span> <span m="2979260">r.</span> <span m="2979870">Because</span> <span m="2980220">we</span> <span m="2980900">have</span> <span m="2981200">k 1</span> <span m="2981630">up</span> <span m="2981690">to</span> <span m="2981830">k</span> <span m="2982300">r in</span> <span m="2982430">here.</span> </p>
<p><span m="2984140">OK</span> <span m="2984460">let's</span> <span m="2985300">see where</span> <span m="2985490">we</span> <span m="2985750">can</span> <span m="2985910">do</span> <span m="2986080">this.</span> <span m="2988610">Well,</span> <span m="2990280">if</span> <span m="2990480">you</span> <span m="2990570">know that</span> <span m="2991050">these</span> <span m="2991410">two</span> <span m="2991580">remainders</span> <span m="2992070">are</span> <span m="2992210">equal</span> <span m="2992510">to</span> <span m="2992640">one</span> <span m="2992820">another,</span> <span m="2993840">we</span> <span m="2993860">can</span> <span m="2994030">look</span> <span m="2994290">at</span> <span m="2994390">them</span> <span m="2995580">with</span> <span m="2995760">respect</span> <span m="2996280">to</span> <span m="2996820">these</span> <span m="2997230">definitions</span> <span m="2997850">over</span> <span m="2998150">here.</span> <span m="2998940">And</span> <span m="2999120">we</span> <span m="2999290">can</span> <span m="3000710">show</span> <span m="3001160">that</span> <span m="3002610">k</span> <span m="3002960">i</span> <span m="3003270">times</span> <span m="3003810">k</span> <span m="3004490">is</span> <span m="3004680">actually</span> <span m="3005110">congruent</span> <span m="3005920">to</span> <span m="3006680">k</span> <span m="3006970">j</span> <span m="3007336">times</span> <span m="3008070">k</span> <span m="3008640">modulo</span> <span m="3009160">n.</span> <span m="3010640">So</span> <span m="3010840">why</span> <span m="3011030">is</span> <span m="3011190">this?</span> <span m="3012170">Well,</span> <span m="3012900">these</span> <span m="3013040">two</span> <span m="3013270">remainders</span> <span m="3013630">are</span> <span m="3013900">the</span> <span m="3013990">same.</span> <span m="3015620">And</span> <span m="3015990">k</span> <span m="3016250">i</span> <span m="3016790">times</span> <span m="3017170">k</span> <span m="3017770">is</span> <span m="3018300">equal</span> <span m="3018590">to</span> <span m="3018690">this</span> <span m="3018950">remainder,</span> <span m="3019370">plus</span> <span m="3019620">a</span> <span m="3019760">multiple</span> <span m="3020220">of</span> <span m="3020310">n.</span> <span m="3021270">This</span> <span m="3022390">k j</span> <span m="3022810">times</span> <span m="3023160">k</span> <span m="3023500">is</span> <span m="3023720">equal</span> <span m="3024060">to</span> <span m="3024660">this</span> <span m="3024890">remainder</span> <span m="3025390">plus,</span> <span m="3025650">a</span> <span m="3025700">multiple</span> <span m="3026190">of</span> <span m="3026280">n.</span> <span m="3027350">So</span> <span m="3027450">the</span> <span m="3027560">difference</span> <span m="3028150">between</span> <span m="3028570">those</span> <span m="3028930">two</span> <span m="3029760">is</span> <span m="3030950">also</span> <span m="3031380">a</span> <span m="3031440">multiple</span> <span m="3031860">of</span> <span m="3031950">n.</span> <span m="3032480">And</span> <span m="3032610">that's</span> <span m="3032760">the</span> <span m="3032850">definition</span> <span m="3033390">of</span> <span m="3033490">congruence.</span> </p>
<p><span m="3036880">So</span> <span m="3037160">now</span> <span m="3038040">we</span> <span m="3038270">can</span> <span m="3039800">use</span> <span m="3040310">our</span> <span m="3041240">first</span> <span m="3041720">lemma,</span> <span m="3042510">which</span> <span m="3043350">is</span> <span m="3043420">stated</span> <span m="3043740">over</span> <span m="3043980">here.</span> <span m="3046040">We</span> <span m="3046200">know</span> <span m="3046660">that</span> <span m="3046950">we</span> <span m="3047110">assumed</span> <span m="3047460">in</span> <span m="3047680">Euler's</span> <span m="3048030">theorem</span> <span m="3048800">that</span> <span m="3048920">the</span> <span m="3049030">GCD</span> <span m="3049550">of</span> <span m="3049670">n</span> <span m="3049870">and</span> <span m="3050020">k</span> <span m="3050210">is</span> <span m="3050350">equal</span> <span m="3050600">to</span> <span m="3050760">1.</span> <span m="3052570">If</span> <span m="3052830">a</span> <span m="3053040">times</span> <span m="3053430">k</span> <span m="3053970">is</span> <span m="3054150">congruent</span> <span m="3054580">to</span> <span m="3054700">b</span> <span m="3054960">times</span> <span m="3055310">k</span> <span m="3055660">modulo</span> <span m="3056140">n,</span> <span m="3057170">then</span> <span m="3057330">we</span> <span m="3057440">know</span> <span m="3057660">that's</span> <span m="3057840">a</span> <span m="3058110">is congruent</span> <span m="3058530">to</span> <span m="3058870">b</span> <span m="3059090">modulo</span> <span m="3059345">n.</span> <span m="3059910">So</span> <span m="3060080">let's</span> <span m="3060280">apply</span> <span m="3060660">it</span> <span m="3060750">over</span> <span m="3061030">here,</span> <span m="3061870">and</span> <span m="3062050">take</span> <span m="3062280">for</span> <span m="3062550">a</span> <span m="3063130">k</span> <span m="3063420">i,</span> <span m="3064370">and</span> <span m="3064530">for</span> <span m="3064730">b</span> <span m="3065030">we</span> <span m="3065130">can</span> <span m="3065330">take</span> <span m="3065770">k</span> <span m="3066050">j.</span> <span m="3067270">So</span> <span m="3067490">now</span> <span m="3067690">we</span> <span m="3067780">see</span> <span m="3068150">that</span> <span m="3068370">key</span> <span m="3068850">k</span> <span m="3069120">i</span> <span m="3069550">is</span> <span m="3069770">congruent</span> <span m="3070410">to</span> <span m="3070530">k</span> <span m="3070976">j</span> <span m="3072470">modulo</span> <span m="3073640">n.</span> <span m="3076010">And</span> <span m="3076170">from</span> <span m="3076370">this</span> <span m="3076850">we will</span> <span m="3077170">conclude--</span> <span m="3078970">and</span> <span m="3079120">that</span> <span m="3079300">takes</span> <span m="3079900">an</span> <span m="3080050">extra</span> <span m="3080440">step--</span> <span m="3081870">that</span> <span m="3082120">k</span> <span m="3082400">i</span> <span m="3082540">is</span> <span m="3082760">actually</span> <span m="3083130">equal</span> <span m="3083350">to</span> <span m="3083490">k j.</span> <span m="3083900">So</span> <span m="3084070">how</span> <span m="3084220">can</span> <span m="3084340">we</span> <span m="3084430">do</span> <span m="3084560">this?</span> </p>
<p><span m="3085950">Well,</span> <span m="3086150">we</span> <span m="3086160">know</span> <span m="3086900">that</span> <span m="3087840">k</span> <span m="3088193">i</span> <span m="3088546">and</span> <span m="3088900">k j</span> <span m="3089050">are</span> <span m="3089260">both</span> <span m="3089590">in</span> <span m="3089720">the</span> <span m="3089820">range</span> <span m="3090370">from</span> <span m="3090620">1</span> <span m="3090870">all</span> <span m="3091070">the</span> <span m="3091150">way</span> <span m="3091340">up</span> <span m="3091490">to</span> <span m="3091640">n</span> <span m="3091810">minus</span> <span m="3092200">1.</span> <span m="3093810">So</span> <span m="3095430">if</span> <span m="3096200">I</span> <span m="3096480">look</span> <span m="3096750">at</span> <span m="3096820">the</span> <span m="3096930">difference</span> <span m="3097400">between</span> <span m="3097740">those</span> <span m="3098000">two--</span> <span m="3098300">so</span> <span m="3098510">by</span> <span m="3098660">definition</span> <span m="3099220">of</span> <span m="3099320">congruence</span> <span m="3099950">I</span> <span m="3100020">know</span> <span m="3101480">that</span> <span m="3101840">n</span> <span m="3102350">divides</span> <span m="3104160">k</span> <span m="3104470">i</span> <span m="3104680">minus</span> <span m="3105260">k</span> <span m="3105705">j.</span> <span m="3106780">I</span> <span m="3106910">know that</span> <span m="3107290">this</span> <span m="3107540">one</span> <span m="3107820">is</span> <span m="3108060">in</span> <span m="3108180">the</span> <span m="3108290">range</span> <span m="3108820">from</span> <span m="3110290">0</span> <span m="3110655">up</span> <span m="3111020">to</span> <span m="3111190">n</span> <span m="3111360">minus</span> <span m="3111780">1.</span> <span m="3112790">This</span> <span m="3112960">one</span> <span m="3113100">is</span> <span m="3113330">in</span> <span m="3113420">the</span> <span m="3113520">range of</span> <span m="3113990">0</span> <span m="3114330">up</span> <span m="3114460">to</span> <span m="3114610">n</span> <span m="3114770">minus</span> <span m="3115180">1.</span> <span m="3115850">The</span> <span m="3116070">only</span> <span m="3116460">way</span> <span m="3117040">how</span> <span m="3117520">a</span> <span m="3117890">difference</span> <span m="3118770">of</span> <span m="3118920">two</span> <span m="3119150">numbers</span> <span m="3119530">in</span> <span m="3119670">this</span> <span m="3119910">range</span> <span m="3120510">can</span> <span m="3120710">be</span> <span m="3120810">divisible</span> <span m="3121330">by</span> <span m="3121510">n,</span> <span m="3121920">is</span> <span m="3122120">if</span> <span m="3122350">this</span> <span m="3122630">thing</span> <span m="3122840">is</span> <span m="3122940">equal</span> <span m="3123170">to</span> <span m="3123260">zero.</span> <span m="3125250">And</span> <span m="3125890">that</span> <span m="3126210">means</span> <span m="3126540">that</span> <span m="3126730">k</span> <span m="3127005">i</span> <span m="3127280">equals</span> <span m="3127720">k</span> <span m="3128025">j.</span> </p>
<p><span m="3129170">So</span> <span m="3129330">now</span> <span m="3129550">we</span> <span m="3129660">are</span> <span m="3129730">done</span> <span m="3129970">with</span> <span m="3130140">the</span> <span m="3130210">first</span> <span m="3130610">part,</span> <span m="3131200">because</span> <span m="3131520">we</span> <span m="3131600">have</span> <span m="3131700">shown</span> <span m="3132070">that</span> <span m="3132520">if</span> <span m="3132700">I</span> <span m="3132770">take</span> <span m="3133080">any</span> <span m="3133420">two</span> <span m="3134040">remainders</span> <span m="3134680">over</span> <span m="3134980">here</span> <span m="3136280">it</span> <span m="3136570">must</span> <span m="3136970">be</span> <span m="3137720">that</span> <span m="3138570">they</span> <span m="3138660">can</span> <span m="3138810">only</span> <span m="3138990">be</span> <span m="3139220">equal</span> <span m="3139440">to</span> <span m="3139560">one</span> <span m="3139730">another</span> <span m="3140220">if,</span> <span m="3140420">actually,</span> <span m="3140840">the k</span> <span m="3141120">i</span> <span m="3141290">is equal</span> <span m="3141560">to</span> <span m="3141670">the</span> <span m="3141790">k</span> <span m="3142045">j.</span> <span m="3142300">So</span> <span m="3142790">actually</span> <span m="3143210">we're</span> <span m="3143320">looking</span> <span m="3143650">at</span> <span m="3143740">the</span> <span m="3143820">same</span> <span m="3144130">remainder.</span> <span m="3144570">So</span> <span m="3145220">they</span> <span m="3145310">remainders</span> <span m="3145790">in</span> <span m="3145900">this</span> <span m="3146080">set</span> <span m="3146250">are</span> <span m="3146390">all</span> <span m="3146650">different,</span> <span m="3147950">and</span> <span m="3148090">there</span> <span m="3148240">are</span> <span m="3148680">exactly</span> <span m="3149200">r of</span> <span m="3149470">those.</span> </p>
<p><span m="3150680">So</span> <span m="3150830">now</span> <span m="3150990">we</span> <span m="3151070">go</span> <span m="3151250">to</span> <span m="3151350">the</span> <span m="3151450">second</span> <span m="3151780">part</span> <span m="3152010">of</span> <span m="3152120">the</span> <span m="3152200">proof.</span> <span m="3169520">And</span> <span m="3169700">notice</span> <span m="3170060">that</span> <span m="3170230">we</span> <span m="3170630">are--</span> <span m="3171500">so</span> <span m="3171780">far</span> <span m="3172040">we've</span> <span m="3172160">only</span> <span m="3172370">been</span> <span m="3172650">proving</span> <span m="3173060">the</span> <span m="3173170">second</span> <span m="3173550">lemma, and</span> <span m="3174040">we</span> <span m="3174190">still</span> <span m="3174470">need</span> <span m="3174610">to</span> <span m="3174700">go</span> <span m="3174880">to</span> <span m="3175140">Euler's</span> <span m="3175610">theorem</span> <span m="3175890">as</span> <span m="3176210">well.</span> <span m="3176990">So</span> <span m="3177140">it</span> <span m="3177260">still</span> <span m="3177570">takes</span> <span m="3177830">a</span> <span m="3177880">few</span> <span m="3178090">steps.</span> <span m="3182560">So</span> <span m="3182730">how</span> <span m="3182880">do</span> <span m="3182990">we</span> <span m="3183110">do</span> <span m="3183230">the</span> <span m="3183360">second</span> <span m="3183750">part?</span> <span m="3185430">Well,</span> <span m="3185660">we</span> <span m="3185780">saw</span> <span m="3186120">in</span> <span m="3186260">last</span> <span m="3186580">lecture</span> <span m="3187640">that</span> <span m="3188820">we</span> <span m="3188950">were</span> <span m="3189200">explaining</span> <span m="3191570">Euclid's</span> <span m="3193110">algorithm.</span> <span m="3194640">And</span> <span m="3194730">we</span> <span m="3194850">used,</span> <span m="3195310">essentially,</span> <span m="3196030">this</span> <span m="3196750">property.</span> <span m="3198650">We</span> <span m="3198740">said</span> <span m="3199250">that</span> <span m="3199500">the</span> <span m="3199580">greatest</span> <span m="3199910">common</span> <span m="3200070">divisor</span> <span m="3200570">between</span> <span m="3201130">n</span> <span m="3202080">and</span> <span m="3202270">the</span> <span m="3202350">remainder</span> <span m="3203310">of</span> <span m="3204510">say,</span> <span m="3204920">k</span> <span m="3205210">i</span> <span m="3205370">times</span> <span m="3205740">k</span> <span m="3206090">and</span> <span m="3206290">n,</span> <span m="3208460">is</span> <span m="3208690">actually</span> <span m="3209070">equal</span> <span m="3209940">to</span> <span m="3210120">the</span> <span m="3210220">greatest</span> <span m="3210810">common</span> <span m="3211040">divisor</span> <span m="3212560">of</span> <span m="3212940">n</span> <span m="3213750">and</span> <span m="3214460">k</span> <span m="3214750">i</span> <span m="3215480">times</span> <span m="3216000">k.</span> </p>
<p><span m="3219090">So</span> <span m="3219310">why</span> <span m="3219480">is</span> <span m="3219620">this,</span> <span m="3219840">again?</span> <span m="3220340">Well,</span> <span m="3220660">the</span> <span m="3220730">remaining</span> <span m="3221730">is</span> <span m="3222640">actually</span> <span m="3224450">equal</span> <span m="3224820">to</span> <span m="3225100">k</span> <span m="3225390">i</span> <span m="3225640">times</span> <span m="3226070">k,</span> <span m="3226320">minus</span> <span m="3226600">a</span> <span m="3226720">multiple</span> <span m="3227170">of</span> <span m="3227300">n,</span> <span m="3227780">right?</span> <span m="3228680">So</span> <span m="3229320">the</span> <span m="3229420">greatest</span> <span m="3229790">common</span> <span m="3230020">divisor</span> <span m="3231460">is</span> <span m="3231660">therefore--</span> <span m="3233080">between n</span> <span m="3233460">and</span> <span m="3233780">this--</span> <span m="3234020">is</span> <span m="3234220">the</span> <span m="3234300">same</span> <span m="3234710">as</span> <span m="3234820">the</span> <span m="3234880">greatest</span> <span m="3235150">common</span> <span m="3235330">divisor</span> <span m="3235720">between</span> <span m="3236060">n</span> <span m="3236240">and</span> <span m="3236360">k</span> <span m="3236570">i</span> <span m="3236700">times</span> <span m="3237050">k.</span> <span m="3237840">So</span> <span m="3237970">you</span> <span m="3238030">should</span> <span m="3238220">have</span> <span m="3238380">to</span> <span m="3238500">look</span> <span m="3238710">at</span> <span m="3238790">last</span> <span m="3239080">lecture.</span> <span m="3240210">And</span> <span m="3241390">now</span> <span m="3241900">we</span> <span m="3242120">are</span> <span m="3242550">pretty</span> <span m="3242790">much</span> <span m="3243030">done.</span> <span m="3244250">Why is this?</span> <span m="3244790">Because</span> <span m="3245640">we have</span> <span m="3245900">assumed</span> <span m="3246570">that</span> <span m="3246630">the</span> <span m="3246700">greatest</span> <span m="3247080">common</span> <span m="3247360">divisor</span> <span m="3247800">between</span> <span m="3248990">n</span> <span m="3249280">and</span> <span m="3249610">k</span> <span m="3249810">is</span> <span m="3249940">equal</span> <span m="3250210">to</span> <span m="3250350">1.</span> <span m="3251631">And</span> <span m="3252060">k</span> <span m="3252395">i,</span> <span m="3252960">in</span> <span m="3253190">the</span> <span m="3253280">statement</span> <span m="3253880">of</span> <span m="3254020">the lemma,</span> <span m="3255150">is</span> <span m="3255390">relatively</span> <span m="3256080">prime</span> <span m="3256510">to</span> <span m="3256750">n.</span> <span m="3257180">And</span> <span m="3257370">that</span> <span m="3257580">means,</span> <span m="3258480">according</span> <span m="3258820">to</span> <span m="3258930">the</span> <span m="3259020">definition</span> <span m="3259660">over</span> <span m="3259890">there,</span> <span m="3260770">that</span> <span m="3260890">the</span> <span m="3260990">greatest</span> <span m="3261380">common</span> <span m="3261570">divisor</span> <span m="3262110">between</span> <span m="3262450">k</span> <span m="3262910">i</span> <span m="3263370">and n</span> <span m="3263830">is</span> <span m="3264030">also</span> <span m="3264370">equal</span> <span m="3264620">to</span> <span m="3264780">1.</span> </p>
<p><span m="3265330">So</span> <span m="3265560">we</span> <span m="3265690">know</span> <span m="3266880">that</span> <span m="3267950">both</span> <span m="3271000">these</span> <span m="3274890">greatest</span> <span m="3275230">common</span> <span m="3275450">divisors</span> <span m="3275720">are</span> <span m="3276120">equal</span> <span m="3276410">to</span> <span m="3276570">1.</span> <span m="3279220">So</span> <span m="3279470">that</span> <span m="3279670">means</span> <span m="3280050">that</span> <span m="3281240">there</span> <span m="3281440">is</span> <span m="3281580">no</span> <span m="3281880">common</span> <span m="3282200">divisor</span> <span m="3282810">between</span> <span m="3283200">n</span> <span m="3283592">and</span> <span m="3284770">these,</span> <span m="3284950">except</span> <span m="3285400">1</span> <span m="3285590">of</span> <span m="3285710">course.</span> <span m="3287600">So</span> <span m="3287700">what does</span> <span m="3287830">this</span> <span m="3288190">say?</span> <span m="3289320">Well,</span> <span m="3289410">this</span> <span m="3289610">means</span> <span m="3290020">that</span> <span m="3290450">this</span> <span m="3290680">remainder,</span> <span m="3292090">according</span> <span m="3292470">to</span> <span m="3292590">our</span> <span m="3292780">definition,</span> <span m="3293560">is</span> <span m="3293730">relatively</span> <span m="3294330">prime</span> <span m="3294900">to</span> <span m="3295100">n,</span> <span m="3295830">because</span> <span m="3296240">this</span> <span m="3296420">greatest</span> <span m="3296700">common</span> <span m="3296890">divisor</span> <span m="3297300">is</span> <span m="3297380">equal</span> <span m="3297630">to</span> <span m="3297770">1.</span> <span m="3299171">So</span> <span m="3299640">if</span> <span m="3299760">it</span> <span m="3299880">is</span> <span m="3300120">an</span> <span m="3302810">integer</span> <span m="3303410">relatively</span> <span m="3303950">prime</span> <span m="3304250">to</span> <span m="3304420">n,</span> <span m="3305420">then</span> <span m="3305570">it</span> <span m="3305670">must</span> <span m="3305860">be</span> <span m="3305990">one</span> <span m="3306170">of</span> <span m="3306300">those</span> <span m="3306620">k</span> <span m="3306880">i's,</span> <span m="3307680">k</span> <span m="3307910">j's</span> <span m="3308460">in</span> <span m="3308660">this</span> <span m="3308880">set</span> <span m="3309400">that is</span> <span m="3309620">stated</span> <span m="3309940">in</span> <span m="3310140">the lemma.</span> <span m="3311820">So</span> <span m="3312000">this</span> <span m="3312210">shows</span> <span m="3313650">that</span> <span m="3314320">it</span> <span m="3314620">must</span> <span m="3314830">be</span> <span m="3315000">part</span> <span m="3315290">of</span> <span m="3315430">this</span> <span m="3315560">set</span> <span m="3315980">over here.</span> <span m="3316290">So</span> <span m="3316360">if</span> <span m="3316960">proven,</span> <span m="3318220">the</span> <span m="3318320">fact</span> <span m="3318520">[? is ?]</span> <span m="3318720">that</span> <span m="3319010">the</span> <span m="3319590">set</span> <span m="3319910">of</span> <span m="3320030">all</span> <span m="3320160">the</span> <span m="3320220">remainders</span> <span m="3320710">is</span> <span m="3320860">a</span> <span m="3320910">subset</span> <span m="3321850">of</span> <span m="3322810">the</span> <span m="3323130">set</span> <span m="3323380">k</span> <span m="3323580">1</span> <span m="3323770">of</span> <span m="3323880">the</span> <span m="3323990">k</span> <span m="3324305">r.</span> <span m="3325350">So</span> <span m="3325490">now</span> <span m="3325660">we're</span> <span m="3325760">done.</span> </p>
<p><span m="3328260">So</span> <span m="3329120">now</span> <span m="3329240">that</span> <span m="3329290">we</span> <span m="3329510">have</span> <span m="3329650">shown</span> <span m="3330010">this</span> <span m="3330230">particular</span> <span m="3332970">lemma,</span> <span m="3334730">we</span> <span m="3334910">can</span> <span m="3335140">continue</span> <span m="3336190">and</span> <span m="3337990">prove</span> <span m="3338560">Euler's</span> <span m="3339000">theorem.</span> <span m="3340420">And</span> <span m="3340670">I'll</span> <span m="3340850">probably</span> <span m="3341190">need</span> <span m="3341610">to</span> <span m="3341950">wipe</span> <span m="3342270">out</span> <span m="3342640">some</span> <span m="3342910">of</span> <span m="3343030">this.</span> <span m="3352750">So</span> <span m="3352960">let's</span> <span m="3353190">use</span> <span m="3353430">this</span> <span m="3353620">lemma</span> <span m="3353990">to</span> <span m="3354090">prove</span> <span m="3354360">this</span> <span m="3354570">theorem.</span> <span m="3356360">So</span> <span m="3356520">this</span> <span m="3356720">is</span> <span m="3356870">really a</span> <span m="3357180">neat</span> <span m="3357470">trick.</span> <span m="3362350">So</span> <span m="3362500">the</span> <span m="3362630">proof</span> <span m="3363020">of</span> <span m="3363890">Euler's</span> <span m="3364440">theorem</span> <span m="3367860">is</span> <span m="3368080">as</span> <span m="3368230">follows.</span> <span m="3369510">We're</span> <span m="3369670">going</span> <span m="3370050">to</span> <span m="3370260">take</span> <span m="3370510">the</span> <span m="3370610">product</span> <span m="3371470">of</span> <span m="3371740">all</span> <span m="3372030">those</span> <span m="3372350">k</span> <span m="3372670">i's</span> <span m="3373000">over</span> <span m="3373280">there,</span> <span m="3374130">and</span> <span m="3374320">see</span> <span m="3375080">where</span> <span m="3375240">we</span> <span m="3375330">can</span> <span m="3375470">find</span> <span m="3375710">a</span> <span m="3375760">nice</span> <span m="3376010">relationship.</span> <span m="3377670">So</span> <span m="3377830">we</span> <span m="3377970">take</span> <span m="3378030">k</span> <span m="3378370">1</span> <span m="3378920">times</span> <span m="3379360">k</span> <span m="3379550">2,</span> <span m="3380810">all</span> <span m="3381050">the</span> <span m="3381140">way</span> <span m="3381340">times</span> <span m="3381800">k</span> <span m="3382170">r.</span> <span m="3383540">And</span> <span m="3383730">we</span> <span m="3383850">know,</span> <span m="3384230">because</span> <span m="3384610">those</span> <span m="3384860">two</span> <span m="3385020">sets</span> <span m="3385400">are</span> <span m="3385580">actually</span> <span m="3385900">the</span> <span m="3386020">same,</span> <span m="3387290">that</span> <span m="3387720">this</span> <span m="3387900">is</span> <span m="3388050">equal</span> <span m="3389110">to</span> <span m="3389250">the</span> <span m="3389390">remainder--</span> <span m="3390310">the</span> <span m="3390400">first</span> <span m="3390770">remainder--</span> <span m="3393740">k 1</span> <span m="3394130">times</span> <span m="3394520">k,</span> <span m="3397230">after</span> <span m="3397500">dividing</span> <span m="3397910">out</span> <span m="3398000">as many</span> <span m="3398280">multiples</span> <span m="3398720">of</span> <span m="3398880">n.</span> <span m="3399520">And</span> <span m="3399640">we</span> <span m="3399710">go</span> <span m="3399930">all</span> <span m="3400180">the</span> <span m="3400260">way</span> <span m="3400520">up</span> <span m="3400720">to</span> <span m="3400880">the</span> <span m="3401000">final</span> <span m="3401470">one,</span> <span m="3402340">the</span> <span m="3402440">remainder</span> <span m="3402990">of</span> <span m="3403320">k r</span> <span m="3405090">times</span> <span m="3405880">k,</span> <span m="3407250">dividing</span> <span m="3407840">out</span> <span m="3407980">as</span> <span m="3408120">many</span> <span m="3408290">multiples</span> <span m="3408770">of</span> <span m="3408940">n.</span> </p>
<p><span m="3410280">So</span> <span m="3410650">now</span> <span m="3412700">we</span> <span m="3412840">can</span> <span m="3413020">see</span> <span m="3414160">that--</span> <span m="3414780">well,</span> <span m="3414990">we've</span> <span m="3415480">already</span> <span m="3415800">shown</span> <span m="3416180">that</span> <span m="3417470">each</span> <span m="3417690">of</span> <span m="3417800">those</span> <span m="3418030">remainders</span> <span m="3419480">is</span> <span m="3419780">congruent</span> <span m="3420420">to,</span> <span m="3420590">in</span> <span m="3420690">this</span> <span m="3420920">case,</span> <span m="3421310">this</span> <span m="3421490">one</span> <span m="3421650">is</span> <span m="3421770">congruent</span> <span m="3422210">to</span> <span m="3422760">k 1</span> <span m="3423240">times</span> <span m="3423580">k</span> <span m="3424040">modulo</span> <span m="3424520">n.</span> <span m="3425210">And</span> <span m="3425340">this</span> <span m="3425520">one</span> <span m="3425690">is</span> <span m="3425810">congruent</span> <span m="3426250">to</span> <span m="3426410">k</span> <span m="3426680">r</span> <span m="3426950">times</span> <span m="3427310">k</span> <span m="3427500">modulo</span> <span m="3427990">n.</span> <span m="3428190">So</span> <span m="3428650">let's</span> <span m="3428920">write</span> <span m="3429130">it out.</span> <span m="3429650">So it's</span> <span m="3429870">k</span> <span m="3430150">1</span> <span m="3430430">times</span> <span m="3430980">k.</span> <span m="3432430">And</span> <span m="3432580">then</span> <span m="3432700">we</span> <span m="3432830">have</span> <span m="3433160">k 2</span> <span m="3433700">times</span> <span m="3434150">k.</span> <span m="3436140">And</span> <span m="3436500">finally</span> <span m="3436930">we</span> <span m="3437050">have</span> <span m="3437330">k</span> <span m="3437695">r</span> <span m="3438060">times</span> <span m="3438500">k</span> <span m="3440120">modulo</span> <span m="3441080">n.</span> <span m="3443890">So</span> <span m="3444090">let's</span> <span m="3444860">regroup</span> <span m="3445440">those.</span> <span m="3446910">We</span> <span m="3447195">see</span> <span m="3447750">k</span> <span m="3447980">1,</span> <span m="3448340">k</span> <span m="3448520">2,</span> <span m="3448820">all</span> <span m="3448950">the</span> <span m="3449030">way</span> <span m="3449150">up</span> <span m="3449330">to</span> <span m="3449410">k</span> <span m="3449670">r</span> <span m="3450130">reappearing.</span> <span m="3455660">And</span> <span m="3456250">we</span> <span m="3456960">have</span> <span m="3457900">a</span> <span m="3458260">k here,</span> <span m="3458620">a k here,</span> <span m="3459280">and</span> <span m="3459640">we</span> <span m="3459770">have</span> <span m="3459960">that</span> <span m="3460190">r</span> <span m="3460480">times--</span> <span m="3461590">so</span> <span m="3461740">we</span> <span m="3461840">have</span> <span m="3462090">times</span> <span m="3462630">k</span> <span m="3462890">to</span> <span m="3463050">the</span> <span m="3463160">power</span> <span m="3463560">r</span> <span m="3465650">modulo</span> <span m="3466160">n.</span> <span m="3467990">So</span> <span m="3468180">now</span> <span m="3468800">we</span> <span m="3469370">are</span> <span m="3469640">able</span> <span m="3470100">to,</span> <span m="3470230">again,</span> <span m="3470880">use</span> <span m="3471250">this</span> <span m="3471470">particular</span> <span m="3471910">lemma</span> <span m="3472250">over</span> <span m="3472550">here.</span> </p>
<p><span m="3473990">So</span> <span m="3474220">what</span> <span m="3474360">do</span> <span m="3474440">we</span> <span m="3474570">do?</span> <span m="3475560">Well,</span> <span m="3477010">we</span> <span m="3477150">know</span> <span m="3477380">that</span> <span m="3477670">k 1</span> <span m="3478400">is</span> <span m="3478620">relatively</span> <span m="3479260">prime</span> <span m="3480410">to</span> <span m="3480640">n.</span> <span m="3481115">And</span> <span m="3481590">k 2</span> <span m="3481920">is</span> <span m="3482090">as</span> <span m="3482290">well,</span> <span m="3483060">all</span> <span m="3483250">the way up to</span> <span m="3483630">k</span> <span m="3483955">r.</span> <span m="3484590">So</span> <span m="3484770">this</span> <span m="3484950">whole</span> <span m="3485170">product</span> <span m="3485850">is</span> <span m="3486070">also</span> <span m="3486450">relatively</span> <span m="3487050">prime,</span> <span m="3487660">with</span> <span m="3487900">respect</span> <span m="3488450">to</span> <span m="3489186">n.</span> <span m="3490080">That</span> <span m="3490280">means</span> <span m="3490510">that</span> <span m="3490630">the</span> <span m="3490710">greatest</span> <span m="3491080">common</span> <span m="3491290">divisor</span> <span m="3491770">of</span> <span m="3491890">this</span> <span m="3492040">whole</span> <span m="3492260">product</span> <span m="3493260">with</span> <span m="3493780">n</span> <span m="3494810">is</span> <span m="3495050">equal</span> <span m="3495310">to</span> <span m="3495470">1.</span> <span m="3497060">So</span> <span m="3497350">that</span> <span m="3497520">means</span> <span m="3497730">that</span> <span m="3497860">I</span> <span m="3497940">can</span> <span m="3498150">divide</span> <span m="3498560">out</span> <span m="3498770">this</span> <span m="3498920">whole</span> <span m="3499160">product.</span> <span m="3501920">We</span> <span m="3502100">have--</span> <span m="3503380">so</span> <span m="3503590">let's</span> <span m="3504220">do</span> <span m="3504380">this.</span> <span m="3505190">We</span> <span m="3505290">have</span> <span m="3506870">1</span> <span m="3507220">times</span> <span m="3507570">this</span> <span m="3507770">product.</span> <span m="3508300">We</span> <span m="3508450">take</span> <span m="3508740">this</span> <span m="3508980">for</span> <span m="3509250">a,</span> <span m="3510606">and</span> <span m="3511060">we</span> <span m="3511220">take</span> <span m="3512000">this</span> <span m="3512420">for</span> <span m="3512720">b.</span> <span m="3513960">And</span> <span m="3514090">then</span> <span m="3514200">we</span> <span m="3514330">can</span> <span m="3514520">divide</span> <span m="3514930">this</span> <span m="3515150">whole</span> <span m="3515430">thing</span> <span m="3515700">out</span> <span m="3518770">according</span> <span m="3519300">to</span> <span m="3519440">this</span> <span m="3519720">particular</span> <span m="3520130">lemma,</span> <span m="3520600">by</span> <span m="3520700">using</span> <span m="3521030">the</span> <span m="3521080">multiplicative</span> <span m="3521780">inverse</span> <span m="3522380">of</span> <span m="3522570">that</span> <span m="3522720">product.</span> <span m="3524760">So</span> <span m="3524860">now</span> <span m="3525580">we</span> <span m="3525750">see</span> <span m="3526550">that</span> <span m="3526730">the</span> <span m="3526810">1</span> <span m="3527670">is</span> <span m="3527870">equal</span> <span m="3528140">to</span> <span m="3528310">k</span> <span m="3528540">to</span> <span m="3528680">the</span> <span m="3528790">power</span> <span m="3529100">r</span> <span m="3529690">modulo</span> <span m="3530290">n.</span> <span m="3531720">And</span> <span m="3531890">remember,</span> <span m="3532660">in</span> <span m="3532890">our</span> <span m="3533200">theorem,</span> <span m="3534120">r</span> <span m="3535470">over</span> <span m="3535760">here</span> <span m="3536010">in</span> <span m="3536210">this</span> <span m="3536370">lemma--</span> <span m="3537120">r</span> <span m="3537400">is</span> <span m="3537540">actually</span> <span m="3537910">equal</span> <span m="3540000">to</span> <span m="3540250">the</span> <span m="3542150">Euler's</span> <span m="3542500">totient</span> <span m="3542850">function</span> <span m="3543340">in</span> <span m="3543530">n.</span> <span m="3544740">So</span> <span m="3544940">now</span> <span m="3545140">this</span> <span m="3545340">equation</span> <span m="3546800">proves</span> <span m="3547300">the</span> <span m="3547380">whole</span> <span m="3547580">theorem.</span> </p>
<p><span m="3549780">OK,</span> <span m="3551880">so</span> <span m="3553700">now</span> <span m="3553810">I'm</span> <span m="3553940">going</span> <span m="3554160">to</span> <span m="3554340">talk</span> <span m="3554680">about</span> <span m="3555370">RSA,</span> <span m="3555890">which</span> <span m="3556030">is</span> <span m="3556160">the</span> <span m="3556260">last</span> <span m="3556890">part</span> <span m="3557260">here.</span> <span m="3557890">So</span> <span m="3558040">maybe</span> <span m="3558700">you</span> <span m="3558870">all</span> <span m="3559060">would</span> <span m="3559190">like</span> <span m="3559430">to</span> <span m="3559870">have</span> <span m="3560080">a</span> <span m="3560140">little</span> <span m="3560320">break</span> <span m="3560660">of</span> <span m="3560780">a</span> <span m="3560860">couple</span> <span m="3561100">of</span> <span m="3561200">minutes,</span> <span m="3562300">just</span> <span m="3562590">to</span> <span m="3563000">relax</span> <span m="3563430">a</span> <span m="3563490">bit.</span> <span m="3564430">And</span> <span m="3564590">then--</span> <span m="3564920">and</span> <span m="3565210">shake</span> <span m="3565450">hands</span> <span m="3565670">with</span> <span m="3565820">your</span> <span m="3565900">neighbors,</span> <span m="3566540">and</span> <span m="3567410">jump</span> <span m="3567660">up</span> <span m="3567940">in</span> <span m="3568090">the</span> <span m="3568250">air</span> <span m="3568500">if</span> <span m="3568640">you'd</span> <span m="3568750">like</span> <span m="3568960">to.</span> </p>
<p><span m="3570150">All</span> <span m="3570270">right</span> <span m="3570480">let's</span> <span m="3570690">start</span> <span m="3571010">with</span> <span m="3571500">the</span> <span m="3571620">RSA</span> <span m="3572050">algorithm.</span> <span m="3573590">So</span> <span m="3573750">we have</span> <span m="3573950">done</span> <span m="3575330">everything</span> <span m="3575920">up</span> <span m="3576040">to</span> <span m="3576160">this</span> <span m="3576420">point.</span> <span m="3577480">And we are</span> <span m="3577640">actually--</span> <span m="3580540">we have</span> <span m="3580630">done</span> <span m="3580850">these</span> <span m="3581160">two</span> <span m="3581360">over</span> <span m="3581620">here.</span> <span m="3582150">We</span> <span m="3582230">still</span> <span m="3582440">have</span> <span m="3582550">to</span> <span m="3582650">talk</span> <span m="3582880">about</span> <span m="3583180">Fermat's</span> <span m="3583580">little</span> <span m="3583810">theorem.</span> <span m="3585300">But</span> <span m="3585410">then</span> <span m="3585540">we</span> <span m="3585630">can</span> <span m="3585790">go</span> <span m="3585960">for</span> <span m="3586120">RSA,</span> <span m="3587030">and</span> <span m="3587270">it</span> <span m="3587380">uses</span> <span m="3587770">this</span> <span m="3588200">consequence</span> <span m="3588990">of</span> <span m="3590110">Euler's</span> <span m="3590750">theorem.</span> </p>
<p><span m="3592470">So</span> <span m="3596840">Fermat's</span> <span m="3597880">little</span> <span m="3598180">theorem</span> <span m="3603470">is</span> <span m="3603720">actually</span> <span m="3604130">talking</span> <span m="3604600">about</span> <span m="3605660">what</span> <span m="3605820">happens</span> <span m="3606300">if</span> <span m="3606420">n</span> <span m="3606660">is a</span> <span m="3607158">prime</span> <span m="3607656">number.</span> <span m="3611640">It</span> <span m="3611790">says,</span> <span m="3612280">well,</span> <span m="3612440">suppose</span> <span m="3613510">p is</span> <span m="3613900">a</span> <span m="3613980">prime.</span> <span m="3619830">And</span> <span m="3620050">if</span> <span m="3620170">you</span> <span m="3620300">have</span> <span m="3620700">k</span> <span m="3622290">in</span> <span m="3622450">the</span> <span m="3622590">range</span> <span m="3623280">1,</span> <span m="3624020">2,</span> <span m="3624530">all</span> <span m="3624720">the</span> <span m="3624810">way</span> <span m="3625000">up</span> <span m="3625100">to</span> <span m="3625240">p</span> <span m="3625440">minus</span> <span m="3625830">1,</span> <span m="3629410">then</span> <span m="3629530">we</span> <span m="3629610">can</span> <span m="3629780">conclude</span> <span m="3630800">that</span> <span m="3631760">k</span> <span m="3632010">to</span> <span m="3632130">the</span> <span m="3632240">power</span> <span m="3632520">of</span> <span m="3632620">p</span> <span m="3632840">minus</span> <span m="3633270">1</span> <span m="3633550">is</span> <span m="3633750">congruent</span> <span m="3634270">to</span> <span m="3634460">1</span> <span m="3634930">modulo</span> <span m="3635460">n.</span> <span m="3637770">And</span> <span m="3637910">we</span> <span m="3637960">can</span> <span m="3638170">directly</span> <span m="3638670">prove</span> <span m="3638980">this</span> <span m="3640040">by</span> <span m="3640300">using</span> <span m="3641070">Euler's</span> <span m="3643680">theorem.</span> <span m="3644150">So</span> <span m="3644300">how</span> <span m="3644420">do</span> <span m="3644510">we</span> <span m="3644610">do</span> <span m="3644770">this?</span> </p>
<p><span m="3646340">Well,</span> <span m="3646530">we</span> <span m="3646640">know that</span> <span m="3646960">p is</span> <span m="3647300">prime.</span> <span m="3649300">So</span> <span m="3649580">the</span> <span m="3649690">numbers</span> <span m="3650130">1,</span> <span m="3654270">2,</span> <span m="3654890">all</span> <span m="3655090">the</span> <span m="3655190">way</span> <span m="3655470">up</span> <span m="3655580">to</span> <span m="3655710">p</span> <span m="3655970">minus</span> <span m="3656380">1,</span> <span m="3657380">are</span> <span m="3657590">actually</span> <span m="3658070">relatively</span> <span m="3658740">prime</span> <span m="3661370">to</span> <span m="3661550">p.</span> <span m="3665000">So</span> <span m="3665320">why is</span> <span m="3665380">that?</span> <span m="3665710">Well,</span> <span m="3665910">p is</span> <span m="3666280">prime.</span> <span m="3666920">So</span> <span m="3667570">the</span> <span m="3667660">greatest</span> <span m="3668000">common</span> <span m="3668400">divisor</span> <span m="3668700">between</span> <span m="3669000">any</span> <span m="3669310">of</span> <span m="3669420">those</span> <span m="3669750">with</span> <span m="3670015">p</span> <span m="3670280">is</span> <span m="3670460">equal</span> <span m="3670700">to 1.</span> <span m="3670840">That's</span> <span m="3672010">the</span> <span m="3672100">definition</span> <span m="3672830">of</span> <span m="3673000">relatively</span> <span m="3673590">prime.</span> <span m="3674640">And</span> <span m="3674710">we</span> <span m="3674820">know</span> <span m="3676380">that</span> <span m="3678290">we</span> <span m="3678430">can</span> <span m="3678620">now</span> <span m="3679470">apply</span> <span m="3681070">Euler's</span> <span m="3681420">theorem</span> <span m="3681800">over</span> <span m="3682080">here,</span> <span m="3682820">and</span> <span m="3683040">see</span> <span m="3683370">that</span> <span m="3684970">k</span> <span m="3685370">to</span> <span m="3685500">the</span> <span m="3685630">power</span> <span m="3686680">phi</span> <span m="3687110">of</span> <span m="3687290">p</span> <span m="3689300">is,</span> <span m="3690090">of</span> <span m="3690220">course,</span> <span m="3691190">congruent</span> <span m="3691640">to</span> <span m="3691760">1</span> <span m="3692210">modulo</span> <span m="3692540">p.</span> <span m="3694390">That's</span> <span m="3694580">Euler's</span> <span m="3694880">theorem.</span> <span m="3696430">But</span> <span m="3696600">now,</span> <span m="3696790">since</span> <span m="3697070">we</span> <span m="3697190">know that</span> <span m="3697540">these</span> <span m="3697830">are</span> <span m="3698040">the exact</span> <span m="3699040">ones</span> <span m="3699450">that</span> <span m="3699510">are relatively</span> <span m="3700210">prime,</span> <span m="3701000">we</span> <span m="3701190">can</span> <span m="3702050">explicitly</span> <span m="3702930">compute</span> <span m="3704040">the</span> <span m="3704360">Euler's totient</span> <span m="3704740">function</span> <span m="3705210">of</span> <span m="3705420">p.</span> <span m="3706290">Because</span> <span m="3706540">there</span> <span m="3706730">are</span> <span m="3706930">p</span> <span m="3707160">minus</span> <span m="3707550">1</span> <span m="3707770">numbers</span> <span m="3708180">that</span> <span m="3708250">are</span> <span m="3708350">relatively</span> <span m="3708860">prime</span> <span m="3709120">to</span> <span m="3709270">p.</span> <span m="3710480">So</span> <span m="3710920">that's</span> <span m="3711120">the</span> <span m="3711190">definition</span> <span m="3712380">over</span> <span m="3712700">here.</span> <span m="3713530">So</span> <span m="3713850">the</span> <span m="3713950">number</span> <span m="3714260">of</span> <span m="3714350">integers</span> <span m="3714950">in</span> <span m="3715090">the</span> <span m="3715200">range</span> <span m="3715530">1</span> <span m="3715780">up</span> <span m="3715900">to p</span> <span m="3716370">minus</span> <span m="3716760">1--</span> <span m="3717870">they're</span> <span m="3718070">all</span> <span m="3718300">relatively</span> <span m="3718820">prime.</span> </p>
<p><span m="3720040">So</span> <span m="3720310">we</span> <span m="3720440">know</span> <span m="3721530">that</span> <span m="3725530">5</span> <span m="3726080">p</span> <span m="3726330">is</span> <span m="3726480">equal</span> <span m="3726680">to</span> <span m="3726800">p</span> <span m="3727080">minus</span> <span m="3727490">1.</span> <span m="3729060">So</span> <span m="3729240">now</span> <span m="3729490">we</span> <span m="3729660">have</span> <span m="3729830">shown</span> <span m="3730500">that</span> <span m="3732420">k</span> <span m="3732620">to</span> <span m="3732770">the</span> <span m="3732890">power</span> <span m="3733190">of</span> <span m="3733230">p</span> <span m="3733470">minus</span> <span m="3733870">1</span> <span m="3734140">is</span> <span m="3734330">congruent</span> <span m="3734830">to</span> <span m="3734980">1</span> <span m="3735400">modulo</span> <span m="3736110">k.</span> <span m="3738320">This</span> <span m="3738500">is</span> <span m="3738620">kind</span> <span m="3738810">of</span> <span m="3738910">interesting</span> <span m="3739670">because</span> <span m="3740530">we</span> <span m="3740650">can</span> <span m="3740810">use</span> <span m="3741050">this</span> <span m="3741540">theorem</span> <span m="3742260">also</span> <span m="3742660">to</span> <span m="3742900">compute</span> <span m="3743280">the</span> <span m="3743350">multiplicative</span> <span m="3744060">inverse</span> <span m="3745150">of</span> <span m="3745560">k,</span> <span m="3746170">in</span> <span m="3746270">this</span> <span m="3746420">particular</span> <span m="3746870">case.</span> <span m="3747830">So</span> <span m="3749130">how</span> <span m="3749270">do</span> <span m="3749350">we</span> <span m="3749460">do</span> <span m="3749630">this?</span> <span m="3751430">We</span> <span m="3751520">just</span> <span m="3751920">take</span> <span m="3752980">k,</span> <span m="3754080">and</span> <span m="3754340">we</span> <span m="3754680">look</span> <span m="3754960">at</span> <span m="3755100">what</span> <span m="3755250">happens</span> <span m="3755630">if</span> <span m="3755780">you</span> <span m="3755870">multiply</span> <span m="3756380">k</span> <span m="3757240">with</span> <span m="3758530">k</span> <span m="3758750">to</span> <span m="3758870">the</span> <span m="3759000">power</span> <span m="3759290">of</span> <span m="3759360">p</span> <span m="3759610">minus</span> <span m="3760150">2.</span> <span m="3761690">Well,</span> <span m="3761830">this</span> <span m="3762040">is</span> <span m="3762200">equal</span> <span m="3763340">to</span> <span m="3763680">k</span> <span m="3763900">to</span> <span m="3764030">the</span> <span m="3764150">power</span> <span m="3764460">p</span> <span m="3764690">minus</span> <span m="3765110">1,</span> <span m="3766170">which</span> <span m="3766340">is</span> <span m="3766490">congruent</span> <span m="3766990">to</span> <span m="3767170">1</span> <span m="3767430">modulo</span> <span m="3769420">p</span> <span m="3770980">according</span> <span m="3771410">to</span> <span m="3774100">Fermat's</span> <span m="3774500">theorem.</span> </p>
<p><span m="3776060">So</span> <span m="3776230">now,</span> <span m="3776460">when</span> <span m="3776610">we</span> <span m="3776760">look</span> <span m="3776980">at</span> <span m="3777050">the</span> <span m="3777130">definition</span> <span m="3777630">of</span> <span m="3777750">multiplicative</span> <span m="3778630">inverse</span> <span m="3780200">over</span> <span m="3780440">here,</span> <span m="3781220">we</span> <span m="3781350">see</span> <span m="3782240">that</span> <span m="3782740">k</span> <span m="3782930">to</span> <span m="3783040">the</span> <span m="3783160">power</span> <span m="3783450">p</span> <span m="3783640">minus</span> <span m="3784080">2</span> <span m="3785240">is</span> <span m="3785430">actually</span> <span m="3785790">the</span> <span m="3785890">multiplicative</span> <span m="3786600">inverse</span> <span m="3787230">of</span> <span m="3787480">k.</span> <span m="3790350">So</span> <span m="3791480">k</span> <span m="3792070">inverse</span> <span m="3792760">is</span> <span m="3792940">actually</span> <span m="3793300">equal</span> <span m="3793710">to</span> <span m="3794520">k</span> <span m="3794740">to</span> <span m="3794850">the</span> <span m="3794970">power</span> <span m="3795240">p</span> <span m="3795550">minus</span> <span m="3796380">2</span> <span m="3798600">modulo</span> <span m="3800430">k.</span> <span m="3802340">All</span> <span m="3802460">right,</span> <span m="3802660">so</span> <span m="3802840">this</span> <span m="3803750">theorem</span> <span m="3804270">we're</span> <span m="3804360">going to</span> <span m="3804680">use</span> <span m="3805000">now</span> <span m="3805180">in the</span> <span m="3805320">description</span> <span m="3805890">of</span> <span m="3806050">RSA.</span> </p>
<p><span m="3809850">As</span> <span m="3810040">I</span> <span m="3810120">said,</span> <span m="3810450">it</span> <span m="3810580">was</span> <span m="3812320">only</span> <span m="3812740">decades</span> <span m="3813340">later,</span> <span m="3813700">after</span> <span m="3814050">Turing,</span> <span m="3816440">Rivest,</span> <span m="3817020">Shamir,</span> <span m="3817540">and</span> <span m="3817730">Adleman</span> <span m="3818150">were</span> <span m="3818220">the</span> <span m="3818330">first</span> <span m="3818980">to</span> <span m="3819440">really</span> <span m="3819790">show</span> <span m="3820480">how</span> <span m="3820580">number</span> <span m="3820680">theory</span> <span m="3821130">could</span> <span m="3821370">be</span> <span m="3821760">applied</span> <span m="3822240">so</span> <span m="3822430">successfully</span> <span m="3823270">in</span> <span m="3823600">cryptography.</span> <span m="3824900">And</span> <span m="3825190">they</span> <span m="3825660">essentially</span> <span m="3826150">showed</span> <span m="3827060">the</span> <span m="3827170">first</span> <span m="3827550">public</span> <span m="3828040">key</span> <span m="3828380">encryption</span> <span m="3828850">scheme</span> <span m="3829820">in</span> <span m="3829960">which</span> <span m="3830150">a</span> <span m="3830240">sender</span> <span m="3830590">and</span> <span m="3830750">receiver</span> <span m="3831220">do</span> <span m="3831310">not</span> <span m="3831590">necessarily</span> <span m="3832130">have</span> <span m="3832320">to</span> <span m="3832860">exchange</span> <span m="3833460">a</span> <span m="3833570">secret</span> <span m="3834020">key.</span> <span m="3834250">That's</span> <span m="3834460">not</span> <span m="3834550">necessary.</span> <span m="3835460">So</span> <span m="3835720">they</span> <span m="3835920">had</span> <span m="3836160">a</span> <span m="3836270">public</span> <span m="3836830">key</span> <span m="3837690">method.</span> <span m="3839140">And</span> <span m="3839420">that's</span> <span m="3839520">still</span> <span m="3840210">used</span> <span m="3840810">today,</span> <span m="3842020">and</span> <span m="3843620">it's</span> <span m="3843850">a</span> <span m="3843900">great</span> <span m="3844150">inventions.</span> </p>
<p><span m="3844880">So</span> <span m="3845140">how</span> <span m="3845320">does the</span> <span m="3845510">RSA</span> <span m="3846020">work?</span> <span m="3847820">Again,</span> <span m="3848160">we</span> <span m="3848290">have</span> <span m="3848470">to</span> <span m="3848620">talk</span> <span m="3849130">with</span> <span m="3849330">an</span> <span m="3849490">encryption</span> <span m="3849940">scheme</span> <span m="3850300">about</span> <span m="3850600">what</span> <span m="3850720">happens</span> <span m="3851080">beforehand.</span> <span m="3852830">So</span> <span m="3853020">beforehand,</span> <span m="3854750">we</span> <span m="3854850">need</span> <span m="3855020">to</span> <span m="3855110">generate</span> <span m="3856190">this</span> <span m="3856540">public</span> <span m="3857010">key</span> <span m="3857320">and a</span> <span m="3857490">secret</span> <span m="3857920">key.</span> <span m="3859660">So</span> <span m="3859760">the</span> <span m="3859950">idea</span> <span m="3860390">is</span> <span m="3860520">that</span> <span m="3860720">the</span> <span m="3860800">receiver</span> <span m="3864590">creates</span> <span m="3867160">a</span> <span m="3867360">public</span> <span m="3867820">key,</span> <span m="3871350">and</span> <span m="3871660">also</span> <span m="3872320">a</span> <span m="3872440">secret</span> <span m="3872910">key.</span> <span m="3876910">He</span> <span m="3877110">will</span> <span m="3877250">publish</span> <span m="3877640">the</span> <span m="3877740">public</span> <span m="3878110">key,</span> <span m="3878550">and</span> <span m="3878620">he will</span> <span m="3878800">keep</span> <span m="3879020">the</span> <span m="3879100">secret</span> <span m="3879430">key</span> <span m="3879590">for</span> <span m="3879780">himself.</span> <span m="3880760">And</span> <span m="3880870">now</span> <span m="3881160">anybody</span> <span m="3882330">can</span> <span m="3882510">use</span> <span m="3882870">the</span> <span m="3882970">public</span> <span m="3883340">key</span> <span m="3883750">to</span> <span m="3883920">encrypt</span> <span m="3884900">a</span> <span m="3884940">message.</span> <span m="3886680">The</span> <span m="3886840">encrypted</span> <span m="3887850">message</span> <span m="3888430">is</span> <span m="3888560">sent</span> <span m="3888800">to</span> <span m="3888870">the</span> <span m="3888950">receiver,</span> <span m="3889690">and</span> <span m="3889840">he's</span> <span m="3890160">going</span> <span m="3890360">to</span> <span m="3890470">use</span> <span m="3891210">his</span> <span m="3891320">secret</span> <span m="3891810">key</span> <span m="3892370">to</span> <span m="3892530">get</span> <span m="3892730">back</span> <span m="3892930">to</span> <span m="3893030">the</span> <span m="3893140">plain</span> <span m="3893490">message.</span> </p>
<p><span m="3895890">So</span> <span m="3896100">how</span> <span m="3896420">is</span> <span m="3896590">he</span> <span m="3896670">going</span> <span m="3896880">to</span> <span m="3897000">do</span> <span m="3897190">this?</span> <span m="3897880">Well in</span> <span m="3898040">the</span> <span m="3898120">first</span> <span m="3898440">step,</span> <span m="3899420">the</span> <span m="3899770">idea</span> <span m="3900120">is</span> <span m="3900860">to</span> <span m="3900960">generate</span> <span m="3902700">two</span> <span m="3903230">distinct</span> <span m="3903790">primes.</span> <span m="3905730">Turns</span> <span m="3906130">out</span> <span m="3906510">that</span> <span m="3906630">this</span> <span m="3906820">can</span> <span m="3906990">be</span> <span m="3907130">done</span> <span m="3907690">in</span> <span m="3907850">a</span> <span m="3907920">very</span> <span m="3908200">efficient</span> <span m="3908670">way.</span> <span m="3910190">There</span> <span m="3911690">are</span> <span m="3911730">lots</span> <span m="3912010">of</span> <span m="3912180">primes</span> <span m="3912830">among</span> <span m="3913180">the</span> <span m="3913280">integers.</span> <span m="3914020">So you</span> <span m="3914300">just</span> <span m="3914680">sample.</span> <span m="3915710">And</span> <span m="3915880">it</span> <span m="3915970">turns</span> <span m="3916270">out</span> <span m="3916420">that</span> <span m="3916560">you</span> <span m="3916660">can</span> <span m="3916900">test</span> <span m="3917650">primality</span> <span m="3921150">with</span> <span m="3921640">a</span> <span m="3921810">pretty</span> <span m="3922080">high</span> <span m="3922330">probability,</span> <span m="3922960">very</span> <span m="3923180">efficiently.</span> <span m="3923840">And</span> <span m="3923950">recently,</span> <span m="3924400">actually,</span> <span m="3924740">there</span> <span m="3924910">has</span> <span m="3925130">been</span> <span m="3925270">a</span> <span m="3925310">deterministic</span> <span m="3926120">algorithm</span> <span m="3927940">that is</span> <span m="3928330">polynomial.</span> <span m="3929100">And</span> <span m="3929270">a</span> <span m="3929300">number</span> <span m="3929510">of</span> <span m="3929640">bits</span> <span m="3929870">of</span> <span m="3930000">the</span> <span m="3930090">primes</span> <span m="3930510">that</span> <span m="3930690">can</span> <span m="3930990">actually</span> <span m="3931840">tell</span> <span m="3932150">you</span> <span m="3932730">whether</span> <span m="3933030">you</span> <span m="3933170">have</span> <span m="3933360">a</span> <span m="3933430">prime</span> <span m="3933710">or</span> <span m="3933790">not.</span> <span m="3934220">So</span> <span m="3934270">you</span> <span m="3934390">can</span> <span m="3934530">do</span> <span m="3934670">this.</span> </p>
<p><span m="3937700">Two,</span> <span m="3938790">we're</span> <span m="3939050">going</span> <span m="3939240">to</span> <span m="3939410">create</span> <span m="3939870">the</span> <span m="3939940">product</span> <span m="3940710">of</span> <span m="3940970">these</span> <span m="3941270">two</span> <span m="3941760">distinct</span> <span m="3942300">primes.</span> <span m="3942790">And</span> <span m="3942890">that's</span> <span m="3943100">where</span> <span m="3943840">our</span> <span m="3944040">assumption</span> <span m="3944540">is</span> <span m="3944720">going</span> <span m="3945080">to</span> <span m="3945410">help</span> <span m="3945780">us.</span> <span m="3947000">That</span> <span m="3947150">it</span> <span m="3947300">is</span> <span m="3947450">hard</span> <span m="3947900">to</span> <span m="3947960">factor</span> <span m="3948430">a</span> <span m="3948870">product</span> <span m="3949610">of</span> <span m="3949780">two</span> <span m="3950050">large</span> <span m="3950410">primes.</span> <span m="3951470">That's</span> <span m="3952030">going</span> <span m="3952280">to</span> <span m="3952400">be</span> <span m="3952540">the</span> <span m="3952730">underlying</span> <span m="3953710">hardness</span> <span m="3954180">assumption</span> <span m="3954740">of</span> <span m="3955310">the</span> <span m="3955460">RSA</span> <span m="3956190">encryption</span> <span m="3956680">scheme.</span> <span m="3959660">So</span> <span m="3959920">let</span> <span m="3960160">n</span> <span m="3960410">be</span> <span m="3960570">this.</span> <span m="3962840">Three,</span> <span m="3964880">we</span> <span m="3965070">are</span> <span m="3965140">going</span> <span m="3965380">to</span> <span m="3965520">select</span> <span m="3969120">an</span> <span m="3969900">integer</span> <span m="3970490">e,</span> <span m="3971790">such</span> <span m="3972160">that</span> <span m="3973680">the</span> <span m="3973790">greatest</span> <span m="3974370">common</span> <span m="3974640">divisor</span> <span m="3975800">of</span> <span m="3976210">e</span> <span m="3976960">with</span> <span m="3977400">the</span> <span m="3977470">product</span> <span m="3978010">p</span> <span m="3978240">minus</span> <span m="3978680">1</span> <span m="3978930">times</span> <span m="3979290">q</span> <span m="3979560">minus</span> <span m="3979970">1</span> <span m="3982060">is</span> <span m="3982310">actually</span> <span m="3982890">equal</span> <span m="3983160">to</span> <span m="3983460">1.</span> <span m="3985850">And</span> <span m="3986030">the</span> <span m="3986110">public--</span> <span m="3987430">and</span> <span m="3987550">once</span> <span m="3987740">we</span> <span m="3987840">have</span> <span m="3988250">created</span> <span m="3988620">this,</span> <span m="3990470">the</span> <span m="3990590">public</span> <span m="3991100">key</span> <span m="3991560">is</span> <span m="3991730">going</span> <span m="3991970">to</span> <span m="3992080">be</span> <span m="3992280">a</span> <span m="3992460">pair</span> <span m="3999350">that</span> <span m="3999540">consists</span> <span m="4000270">of</span> <span m="4000520">e</span> <span m="4000720">itself</span> <span m="4001860">together</span> <span m="4002110">with</span> <span m="4002430">n.</span> <span m="4004650">So</span> <span m="4004800">that's</span> <span m="4005030">the</span> <span m="4005080">public</span> <span m="4005440">key.</span> </p>
<p><span m="4006670">And</span> <span m="4006910">the</span> <span m="4007000">secret</span> <span m="4007480">key</span> <span m="4008020">is</span> <span m="4008270">going</span> <span m="4008590">to</span> <span m="4008780">be</span> <span m="4009930">computed</span> <span m="4010350">as</span> <span m="4010500">follows,</span> <span m="4011800">in</span> <span m="4011940">step</span> <span m="4012210">four.</span> <span m="4014470">We are going</span> <span m="4014770">to</span> <span m="4014950">compute.</span> <span m="4018750">d,</span> <span m="4020350">such</span> <span m="4020800">that</span> <span m="4022200">d</span> <span m="4023140">times</span> <span m="4023470">e</span> <span m="4023930">is</span> <span m="4024160">congruent</span> <span m="4024720">to</span> <span m="4024910">1</span> <span m="4025800">modulo</span> <span m="4029290">that</span> <span m="4029650">product</span> <span m="4030230">of</span> <span m="4030510">p</span> <span m="4030740">minus</span> <span m="4031190">1</span> <span m="4032220">times</span> <span m="4032760">q</span> <span m="4033210">minus</span> <span m="4033640">1.</span> <span m="4036010">Can</span> <span m="4036160">we</span> <span m="4036270">do</span> <span m="4036410">this?</span> <span m="4037260">Yeah,</span> <span m="4037650">because</span> <span m="4039290">the</span> <span m="4039510">greatest</span> <span m="4039820">common</span> <span m="4040020">divisor</span> <span m="4040450">between</span> <span m="4040900">e</span> <span m="4041180">and</span> <span m="4041460">that</span> <span m="4041580">product</span> <span m="4042030">is</span> <span m="4042150">equal</span> <span m="4042390">to</span> <span m="4042540">1.</span> <span m="4043860">And</span> <span m="4044300">we</span> <span m="4044420">have</span> <span m="4044510">shown</span> <span m="4044820">over</span> <span m="4045060">here</span> <span m="4045860">that,</span> <span m="4046180">therefore,</span> <span m="4046700">it</span> <span m="4046770">has</span> <span m="4047370">a</span> <span m="4047540">multiplicative</span> <span m="4048270">inverse.</span> <span m="4048790">And</span> <span m="4048850">first</span> <span m="4049140">of</span> <span m="4049210">all,</span> <span m="4049410">we</span> <span m="4049540">know</span> <span m="4050500">that</span> <span m="4050650">the</span> <span m="4050730">solution</span> <span m="4051290">d</span> <span m="4051470">exists,</span> <span m="4052820">and</span> <span m="4052970">we</span> <span m="4053030">can</span> <span m="4053200">also</span> <span m="4053400">efficiently</span> <span m="4054010">compute</span> <span m="4054305">it.</span> </p>
<p><span m="4056070">So</span> <span m="4058870">the</span> <span m="4058990">secret</span> <span m="4059460">key</span> <span m="4060520">is</span> <span m="4060740">going</span> <span m="4060950">to</span> <span m="4061070">be</span> <span m="4061380">the pair</span> <span m="4067840">that</span> <span m="4068030">consists</span> <span m="4068620">of</span> <span m="4068880">d</span> <span m="4069830">and</span> <span m="4070030">also</span> <span m="4070410">n.</span> <span m="4071730">So</span> <span m="4072610">how</span> <span m="4072770">does</span> <span m="4072960">it</span> <span m="4073070">work?</span> <span m="4073530">The</span> <span m="4074950">sender</span> <span m="4076960">knows</span> <span m="4077230">the public</span> <span m="4077750">key,</span> <span m="4078005">e</span> <span m="4078260">and</span> <span m="4078360">n,</span> <span m="4078720">and</span> <span m="4078890">uses</span> <span m="4079310">those</span> <span m="4079620">to</span> <span m="4079730">encrypt</span> <span m="4080120">a</span> <span m="4080160">message.</span> <span m="4080690">I</span> <span m="4080720">will</span> <span m="4080840">explain</span> <span m="4081240">it in</span> <span m="4081400">a</span> <span m="4081440">moment.</span> <span m="4082340">And</span> <span m="4082610">then</span> <span m="4084020">the</span> <span m="4084610">receiver</span> <span m="4085300">knows</span> <span m="4085610">the</span> <span m="4085670">secret</span> <span m="4086120">key,</span> <span m="4086583">d</span> <span m="4087046">and n,</span> <span m="4087510">and</span> <span m="4087710">then</span> <span m="4088430">is</span> <span m="4088630">able</span> <span m="4088840">to</span> <span m="4088950">decrypt.</span> <span m="4090130">OK,</span> <span m="4090500">so</span> <span m="4090750">let's</span> <span m="4091900">see</span> <span m="4092190">how</span> <span m="4092430">encryption</span> <span m="4092980">works.</span> <span m="4095050">And</span> <span m="4095330">then</span> <span m="4096090">we</span> <span m="4096210">will</span> <span m="4096370">have</span> <span m="4096550">to</span> <span m="4096630">do</span> <span m="4096740">a</span> <span m="4096840">lot</span> <span m="4097029">of</span> <span m="4097160">mathematics</span> <span m="4098170">to</span> <span m="4098520">get</span> <span m="4098830">the</span> <span m="4098950">decryption</span> <span m="4099450">going.</span> </p>
<p><span m="4101060">So</span> <span m="4101420">m</span> <span m="4101609">prime,</span> <span m="4102720">which</span> <span m="4103000">is</span> <span m="4104800">computed--</span> <span m="4105500">so</span> <span m="4105760">the</span> <span m="4105800">encrypted</span> <span m="4106479">plain</span> <span m="4106870">text</span> <span m="4107170">is</span> <span m="4107330">computed</span> <span m="4108220">as</span> <span m="4108420">the</span> <span m="4108640">remainder</span> <span m="4109590">of</span> <span m="4109899">m</span> <span m="4110160">to</span> <span m="4110260">the</span> <span m="4110439">power</span> <span m="4110870">e--</span> <span m="4111410">which</span> <span m="4111590">is</span> <span m="4111729">part</span> <span m="4112020">of the</span> <span m="4112069">public</span> <span m="4112399">key--</span> <span m="4113870">and</span> <span m="4114100">then</span> <span m="4114319">dividing</span> <span m="4114800">out</span> <span m="4114939">as</span> <span m="4115250">many</span> <span m="4115910">multiples</span> <span m="4116450">of</span> <span m="4116609">n</span> <span m="4116750">as</span> <span m="4116880">possible.</span> <span m="4118850">It</span> <span m="4119080">turns</span> <span m="4119460">out--</span> <span m="4120510">and</span> <span m="4120670">we are</span> <span m="4120925">going to</span> <span m="4121180">prove</span> <span m="4121520">this--</span> <span m="4122790">that</span> <span m="4123340">decryption</span> <span m="4123859">works</span> <span m="4125290">as</span> <span m="4125500">follows.</span> <span m="4126720">We</span> <span m="4126810">can</span> <span m="4127580">compute</span> <span m="4128160">m</span> <span m="4129300">by</span> <span m="4129450">using m</span> <span m="4129920">prime.</span> <span m="4130760">So</span> <span m="4130960">we</span> <span m="4131080">receive</span> <span m="4131460">m</span> <span m="4131630">prime.</span> <span m="4132880">What</span> <span m="4132930">do</span> <span m="4133010">we</span> <span m="4133120">do?</span> <span m="4134100">We're</span> <span m="4134260">going</span> <span m="4134550">to</span> <span m="4134770">take</span> <span m="4135090">m</span> <span m="4135399">prime,</span> <span m="4136140">raise</span> <span m="4136410">it</span> <span m="4136510">to</span> <span m="4136609">the</span> <span m="4136710">power</span> <span m="4137050">d--</span> <span m="4137810">which</span> <span m="4138000">is</span> <span m="4139189">part</span> <span m="4139399">of</span> <span m="4139470">the</span> <span m="4139560">secret</span> <span m="4139970">key--</span> <span m="4140840">and</span> <span m="4140990">then</span> <span m="4141130">dividing</span> <span m="4141609">out</span> <span m="4141710">as</span> <span m="4141850">many</span> <span m="4142090">multiples</span> <span m="4142620">of</span> <span m="4142710">n.</span> </p>
<p><span m="4144890">Now,</span> <span m="4145029">why</span> <span m="4145189">would</span> <span m="4145359">that</span> <span m="4145479">work?</span> <span m="4148200">Why</span> <span m="4148340">would</span> <span m="4148529">this</span> <span m="4148740">work?</span> <span m="4149240">So</span> <span m="4149410">let's</span> <span m="4149660">prove</span> <span m="4151710">this</span> <span m="4151890">step</span> <span m="4152220">over</span> <span m="4152479">here.</span> <span m="4155590">Well,</span> <span m="4155890">it</span> <span m="4155979">turns</span> <span m="4156260">out</span> <span m="4156390">that</span> <span m="4156470">they</span> <span m="4156550">can</span> <span m="4156729">apply</span> <span m="4157080">Fermat's</span> <span m="4157880">theorem,</span> <span m="4160439">and</span> <span m="4161380">the</span> <span m="4161670">idea</span> <span m="4161899">is</span> <span m="4162029">as</span> <span m="4162170">follows.</span> <span m="4163430">So</span> <span m="4163979">let's</span> <span m="4164229">have</span> <span m="4164410">a</span> <span m="4164470">look.</span> <span m="4164790">We</span> <span m="4164939">know</span> <span m="4165180">that</span> <span m="4165279">m</span> <span m="4165569">prime</span> <span m="4166779">is</span> <span m="4167040">equal</span> <span m="4167399">to</span> <span m="4167529">the</span> <span m="4167630">remainder</span> <span m="4169160">of</span> <span m="4170470">m</span> <span m="4170830">raised</span> <span m="4171100">to</span> <span m="4171160">the</span> <span m="4171260">power</span> <span m="4171580">e,</span> <span m="4173920">which</span> <span m="4174109">is</span> <span m="4174260">congruent</span> <span m="4174830">to</span> <span m="4175229">m</span> <span m="4175450">to</span> <span m="4175560">the</span> <span m="4175670">power</span> <span m="4176130">e,</span> <span m="4176490">modulo</span> <span m="4177029">n.</span> <span m="4179029">We've</span> <span m="4179200">seen</span> <span m="4179470">this</span> <span m="4179620">now</span> <span m="4179770">a</span> <span m="4179810">number</span> <span m="4180090">of</span> <span m="4180220">times,</span> <span m="4180550">right?</span> </p>
<p><span m="4182200">So</span> <span m="4183600">what</span> <span m="4183729">does</span> <span m="4183920">this</span> <span m="4184109">imply?</span> <span m="4185310">This</span> <span m="4185479">implies</span> <span m="4186180">that</span> <span m="4186979">m</span> <span m="4187439">prime</span> <span m="4189470">to</span> <span m="4189609">the</span> <span m="4189740">power</span> <span m="4190109">d</span> <span m="4191390">is</span> <span m="4191600">actually</span> <span m="4192029">equal--</span> <span m="4192939">is</span> <span m="4193300">congruent</span> <span m="4193950">to</span> <span m="4194285">m</span> <span m="4194620">to</span> <span m="4194750">the</span> <span m="4194870">power</span> <span m="4195350">e,</span> <span m="4196510">to</span> <span m="4196850">the</span> <span m="4196960">power</span> <span m="4197280">d.</span> <span m="4197900">So</span> <span m="4198210">I</span> <span m="4198280">just</span> <span m="4198600">raised</span> <span m="4198810">this</span> <span m="4198990">side</span> <span m="4199180">to</span> <span m="4199260">the</span> <span m="4199380">power</span> <span m="4199660">d,</span> <span m="4200390">and</span> <span m="4200610">I</span> <span m="4200650">raised</span> <span m="4200930">this</span> <span m="4201130">side</span> <span m="4201350">to</span> <span m="4201440">the</span> <span m="4201550">power</span> <span m="4201860">d.</span> <span m="4203030">And</span> <span m="4203210">I</span> <span m="4203260">still--</span> <span m="4205940">and</span> <span m="4206980">I</span> <span m="4207050">know,</span> <span m="4207290">now,</span> <span m="4207560">that</span> <span m="4207930">m</span> <span m="4208390">prime</span> <span m="4208620">to</span> <span m="4208730">the</span> <span m="4208800">power</span> <span m="4209040">d is</span> <span m="4209340">equal</span> <span m="4209550">to</span> <span m="4209700">m</span> <span m="4209890">to</span> <span m="4209990">the</span> <span m="4210100">power</span> <span m="4210410">e</span> <span m="4210670">d--</span> <span m="4211540">congruent</span> <span m="4211980">to</span> <span m="4212100">m</span> <span m="4212270">to the</span> <span m="4212470">power</span> <span m="4212650">e d</span> <span m="4213150">modulo</span> <span m="4213390">n.</span> <span m="4215420">So</span> <span m="4215630">now</span> <span m="4216160">we</span> <span m="4216390">know</span> <span m="4216800">that</span> <span m="4217050">there</span> <span m="4217210">exists</span> <span m="4217750">an</span> <span m="4217900">integer</span> <span m="4218390">r.</span> <span m="4219970">We</span> <span m="4220530">are</span> <span m="4220650">going</span> <span m="4220860">to</span> <span m="4220990">use</span> <span m="4221700">the</span> <span m="4221800">fact</span> <span m="4222230">that</span> <span m="4222370">we</span> <span m="4222480">have</span> <span m="4222910">that</span> <span m="4223190">e</span> <span m="4223450">and</span> <span m="4223600">p</span> <span m="4223830">minus</span> <span m="4224240">1</span> <span m="4224430">times q</span> <span m="4224670">minus</span> <span m="4225150">1</span> <span m="4225740">as</span> <span m="4225910">a</span> <span m="4225950">greatest</span> <span m="4226280">common</span> <span m="4226470">divisor</span> <span m="4226950">over</span> <span m="4227110">1.</span> <span m="4228020">So</span> <span m="4228220">we</span> <span m="4228330">know that</span> <span m="4229260">e</span> <span m="4229490">times</span> <span m="4230030">d</span> <span m="4231970">is</span> <span m="4232170">actually</span> <span m="4232550">equal</span> <span m="4233510">to</span> <span m="4234720">1,</span> <span m="4235290">plus</span> <span m="4235930">r</span> <span m="4236720">times</span> <span m="4238260">p</span> <span m="4238490">minus</span> <span m="4238950">1,</span> <span m="4239180">times</span> <span m="4239490">q</span> <span m="4239690">minus</span> <span m="4240010">1.</span> <span m="4240320">Actually,</span> <span m="4240640">what</span> <span m="4240800">I</span> <span m="4240850">use</span> <span m="4241210">here</span> <span m="4241550">is</span> <span m="4243410">the</span> <span m="4243480">fact--</span> <span m="4244600">is</span> <span m="4244790">this</span> <span m="4245000">over</span> <span m="4245260">here.</span> </p>
<p><span m="4246310">By</span> <span m="4246420">definition</span> <span m="4247390">of</span> <span m="4247610">congruency,</span> <span m="4248350">I</span> <span m="4248400">know</span> <span m="4248710">that the</span> <span m="4248800">difference</span> <span m="4249300">between</span> <span m="4249620">those</span> <span m="4249950">two--</span> <span m="4250440">d</span> <span m="4250915">times</span> <span m="4251390">e</span> <span m="4251790">and</span> <span m="4251970">1--</span> <span m="4253240">is</span> <span m="4253450">divisible</span> <span m="4254130">by</span> <span m="4254290">this</span> <span m="4254480">product.</span> <span m="4255430">So</span> <span m="4255610">I</span> <span m="4255690">know</span> <span m="4255860">that</span> <span m="4255970">there</span> <span m="4256110">exists</span> <span m="4256490">an</span> <span m="4256600">integer</span> <span m="4257540">such</span> <span m="4257590">that</span> <span m="4257950">e</span> <span m="4258120">times</span> <span m="4258400">d</span> <span m="4258630">equals</span> <span m="4258900">1,</span> <span m="4259190">plus</span> <span m="4259580">a</span> <span m="4259670">multiple</span> <span m="4260230">of</span> <span m="4260310">that</span> <span m="4260440">product.</span> <span m="4262070">That's</span> <span m="4262260">how</span> <span m="4262420">it</span> <span m="4262540">works.</span> <span m="4264860">So</span> <span m="4266750">we</span> <span m="4266890">know</span> <span m="4267110">that</span> <span m="4267370">m</span> <span m="4267730">prime</span> <span m="4268230">to</span> <span m="4268340">the</span> <span m="4268460">power</span> <span m="4268800">d--</span> <span m="4269420">we</span> <span m="4269540">already</span> <span m="4269850">saw</span> <span m="4270250">that</span> <span m="4270500">it is</span> <span m="4270670">equal</span> <span m="4270980">to</span> <span m="4271190">m</span> <span m="4271420">to</span> <span m="4271520">the</span> <span m="4271640">power</span> <span m="4272010">e</span> <span m="4272280">d,</span> <span m="4274670">which</span> <span m="4274880">is</span> <span m="4275080">congruent</span> <span m="4275740">to--</span> <span m="4276750">well,</span> <span m="4276940">we</span> <span m="4277060">just</span> <span m="4277410">replace</span> <span m="4278040">e d</span> <span m="4278420">by</span> <span m="4278610">1</span> <span m="4278860">plus</span> <span m="4279140">r</span> <span m="4279410">times</span> <span m="4279670">this</span> <span m="4279810">multiple.</span> <span m="4280960">So</span> <span m="4281110">we</span> <span m="4281260">have</span> <span m="4281880">m</span> <span m="4282090">to</span> <span m="4282210">the</span> <span m="4282330">power</span> <span m="4282680">1,</span> <span m="4284420">times</span> <span m="4285000">m</span> <span m="4285220">to</span> <span m="4285360">the</span> <span m="4285470">power--</span> <span m="4286710">this</span> <span m="4286970">part--</span> <span m="4287640">r</span> <span m="4288610">p</span> <span m="4288820">minus</span> <span m="4289230">1,</span> <span m="4289960">q</span> <span m="4290220">minus</span> <span m="4290560">1.</span> </p>
<p><span m="4295220">So</span> <span m="4298300">now</span> <span m="4298680">we're</span> <span m="4298950">finally</span> <span m="4300480">going</span> <span m="4302550">get</span> <span m="4302750">to</span> <span m="4302990">Fermat's</span> <span m="4303900">theorem.</span> <span m="4305450">We</span> <span m="4305520">know that</span> <span m="4305950">n</span> <span m="4306320">is</span> <span m="4306480">the</span> <span m="4306580">products</span> <span m="4306960">of</span> <span m="4307110">p</span> <span m="4307340">and</span> <span m="4307450">q,</span> <span m="4308820">and</span> <span m="4310320">I'm</span> <span m="4310420">not</span> <span m="4310670">actually</span> <span m="4310940">sure</span> <span m="4311290">I</span> <span m="4311380">do</span> <span m="4311570">this</span> <span m="4311820">here.</span> <span m="4315130">So</span> <span m="4317420">let's</span> <span m="4317620">apply</span> <span m="4317950">Fermat's</span> <span m="4318430">theorem</span> <span m="4319110">and</span> <span m="4319260">see</span> <span m="4319430">how</span> <span m="4319560">we</span> <span m="4319670">can</span> <span m="4320220">use</span> <span m="4320570">this.</span> <span m="4320870">So</span> <span m="4321030">if</span> <span m="4321260">m</span> <span m="4322290">is</span> <span m="4322530">not</span> <span m="4323820">congruent</span> <span m="4324260">to</span> <span m="4324350">0</span> <span m="4324760">modulo</span> <span m="4325260">p,</span> <span m="4328320">well</span> <span m="4328560">then</span> <span m="4328720">we</span> <span m="4328850">can</span> <span m="4329040">apply</span> <span m="4329340">Fermat's</span> <span m="4330140">theorem.</span> <span m="4331670">Where is it?</span> <span m="4332080">It's</span> <span m="4332550">over</span> <span m="4332780">here.</span> <span m="4334480">We</span> <span m="4334560">can</span> <span m="4334720">only</span> <span m="4335010">apply</span> <span m="4335490">this</span> <span m="4336620">if</span> <span m="4337040">k</span> <span m="4337500">is in</span> <span m="4337600">the</span> <span m="4337710">range</span> <span m="4338390">from</span> <span m="4338660">1</span> <span m="4338830">to</span> <span m="4338960">p</span> <span m="4339140">minus</span> <span m="4339470">1</span> <span m="4339640">is</span> <span m="4339740">not</span> <span m="4339890">equal</span> <span m="4340130">to</span> <span m="4340200">zero.</span> <span m="4341640">So</span> <span m="4342080">if</span> <span m="4342330">m</span> <span m="4342600">is</span> <span m="4342730">not</span> <span m="4342910">equal</span> <span m="4343260">to</span> <span m="4343380">0--</span> <span m="4344320">not</span> <span m="4344520">congruent</span> <span m="4344950">to</span> <span m="4345050">0</span> <span m="4345410">modulo</span> <span m="4345830">p--</span> <span m="4347020">then</span> <span m="4348140">we</span> <span m="4348240">can</span> <span m="4348400">apply</span> <span m="4349180">the</span> <span m="4349280">theorem</span> <span m="4350040">and</span> <span m="4350210">state</span> <span m="4350700">that</span> <span m="4350860">m</span> <span m="4351140">to</span> <span m="4351220">the</span> <span m="4351330">power</span> <span m="4351640">p</span> <span m="4351870">minus</span> <span m="4352270">1</span> <span m="4353000">is</span> <span m="4353230">congruent</span> <span m="4353750">to</span> <span m="4353930">1</span> <span m="4354830">modulo</span> <span m="4355340">p.</span> </p>
<p><span m="4357960">And</span> <span m="4358160">in</span> <span m="4358230">the</span> <span m="4358320">same</span> <span m="4358640">way,</span> <span m="4360500">we</span> <span m="4360630">can</span> <span m="4360790">do</span> <span m="4360900">this</span> <span m="4361140">for</span> <span m="4361340">q.</span> <span m="4362440">So</span> <span m="4362780">if</span> <span m="4362900">this</span> <span m="4363070">is</span> <span m="4363260">not</span> <span m="4363440">true--</span> <span m="4364820">modulo</span> <span m="4366330">q--</span> <span m="4368050">then</span> <span m="4368640">m</span> <span m="4368880">to</span> <span m="4368970">the</span> <span m="4369110">power</span> <span m="4369410">q</span> <span m="4369750">minus</span> <span m="4370190">1</span> <span m="4370530">is</span> <span m="4370720">congruent</span> <span m="4371220">to</span> <span m="4371370">1</span> <span m="4371780">modulo</span> <span m="4373720">q.</span> <span m="4374120">So</span> <span m="4374320">here</span> <span m="4374540">we</span> <span m="4374840">have</span> <span m="4374910">used</span> <span m="4375240">Fermat's</span> <span m="4375940">theorem</span> <span m="4376360">twice.</span> <span m="4379890">Now</span> <span m="4380190">we</span> <span m="4380340">can</span> <span m="4380550">apply</span> <span m="4381960">what</span> <span m="4382210">we</span> <span m="4382320">have</span> <span m="4382530">learned</span> <span m="4382760">before,</span> <span m="4384330">which</span> <span m="4384640">is</span> <span m="4385830">what</span> <span m="4386020">we</span> <span m="4386160">wrote</span> <span m="4386450">down</span> <span m="4386980">over</span> <span m="4387290">here.</span> <span m="4387990">And</span> <span m="4388230">prime</span> <span m="4388490">to</span> <span m="4388600">the</span> <span m="4388710">power</span> <span m="4389010">d</span> <span m="4389830">is</span> <span m="4390240">congruent</span> <span m="4390690">to</span> <span m="4390820">this</span> <span m="4391260">modulo</span> <span m="4391770">n.</span> <span m="4393110">Now</span> <span m="4393370">n</span> <span m="4393540">is</span> <span m="4393880">p</span> <span m="4394070">times</span> <span m="4394490">q,</span> <span m="4394960">so</span> <span m="4395660">let's</span> <span m="4395840">have</span> <span m="4396020">a</span> <span m="4396100">look</span> <span m="4396420">at</span> <span m="4396770">what</span> <span m="4396940">that</span> <span m="4397110">means.</span> <span m="4397890">It</span> <span m="4398060">means</span> <span m="4398370">that</span> <span m="4400090">since</span> <span m="4400580">n</span> <span m="4400830">is</span> <span m="4401060">a</span> <span m="4401160">product</span> <span m="4401660">of</span> <span m="4401800">p</span> <span m="4402030">and</span> <span m="4402180">q,</span> <span m="4403140">we</span> <span m="4403270">can</span> <span m="4403510">also</span> <span m="4404100">look</span> <span m="4404310">at</span> <span m="4404420">this</span> <span m="4406250">congruent</span> <span m="4406880">modulo</span> <span m="4407310">p.</span> <span m="4407730">So</span> <span m="4407900">in</span> <span m="4407980">particular,</span> <span m="4409850">we</span> <span m="4409950">know</span> <span m="4410200">that</span> <span m="4410410">m</span> <span m="4410750">prime</span> <span m="4411540">to</span> <span m="4411640">the</span> <span m="4411750">power</span> <span m="4412170">d</span> <span m="4413060">is</span> <span m="4413270">congruent</span> <span m="4413820">to</span> <span m="4414100">m</span> <span m="4414520">times</span> <span m="4415190">m</span> <span m="4415615">r</span> <span m="4416040">p</span> <span m="4416890">minus</span> <span m="4417300">1</span> <span m="4417520">times</span> <span m="4417860">q</span> <span m="4418800">minus</span> <span m="4419190">1</span> <span m="4419510">modulo</span> <span m="4421720">p.</span> <span m="4422280">Why</span> <span m="4422460">is</span> <span m="4422650">that?</span> </p>
<p><span m="4423540">Well,</span> <span m="4423790">we</span> <span m="4423910">know</span> <span m="4424390">that n</span> <span m="4424750">divides</span> <span m="4425360">this</span> <span m="4425690">difference</span> <span m="4426670">by</span> <span m="4426800">the</span> <span m="4426890">definition</span> <span m="4427410">of</span> <span m="4427540">congruency.</span> <span m="4429270">n</span> <span m="4429790">is</span> <span m="4430020">equal</span> <span m="4430290">to</span> <span m="4430420">p</span> <span m="4430640">times</span> <span m="4431020">q.</span> <span m="4432450">So</span> <span m="4432670">if</span> <span m="4432830">n</span> <span m="4433950">is</span> <span m="4434550">dividing</span> <span m="4434940">this</span> <span m="4435150">difference,</span> <span m="4436270">also</span> <span m="4436670">p</span> <span m="4437010">is</span> <span m="4437260">dividing</span> <span m="4437600">this</span> <span m="4437810">difference.</span> <span m="4438770">So</span> <span m="4438940">that's</span> <span m="4439190">why</span> <span m="4439340">we</span> <span m="4439460">can</span> <span m="4439620">write</span> <span m="4439870">it</span> <span m="4440050">m</span> <span m="4440250">prime</span> <span m="4440660">to</span> <span m="4440770">the</span> <span m="4440860">power</span> <span m="4441100">d</span> <span m="4441140">is</span> <span m="4441380">congruent</span> <span m="4441830">to</span> <span m="4441940">this</span> <span m="4442250">thing,</span> <span m="4442980">modulo</span> <span m="4443390">p.</span> <span m="4445380">And</span> <span m="4445540">of</span> <span m="4445690">course,</span> <span m="4445980">we</span> <span m="4446100">can</span> <span m="4446920">repeat</span> <span m="4447370">this</span> <span m="4447900">for</span> <span m="4448130">q.</span> <span m="4451100">So</span> <span m="4451360">let</span> <span m="4451510">me</span> <span m="4451640">write</span> <span m="4451870">this</span> <span m="4452100">out</span> <span m="4452340">as</span> <span m="4452480">well.</span> <span m="4457930">So</span> <span m="4458150">there</span> <span m="4458420">it</span> <span m="4458490">is.</span> <span m="4461600">So</span> <span m="4461830">now</span> <span m="4462100">we</span> <span m="4462290">can</span> <span m="4464380">there</span> <span m="4465270">use</span> <span m="4466040">what</span> <span m="4466240">we</span> <span m="4466400">have</span> <span m="4466620">figured</span> <span m="4466930">out</span> <span m="4467100">over</span> <span m="4467360">here.</span> </p>
<p><span m="4468400">So</span> <span m="4468630">we</span> <span m="4468750">know</span> <span m="4468960">that</span> <span m="4469990">if</span> <span m="4470520">m</span> <span m="4470830">is</span> <span m="4471100">not</span> <span m="4471410">equal</span> <span m="4471690">to</span> <span m="4471790">0,</span> <span m="4473560">then</span> <span m="4474160">this</span> <span m="4474860">thing</span> <span m="4475230">over</span> <span m="4475600">here</span> <span m="4477480">cancels</span> <span m="4477970">out.</span> <span m="4478180">Because</span> <span m="4478500">m</span> <span m="4478660">to</span> <span m="4478740">the</span> <span m="4478850">power</span> <span m="4479080">p</span> <span m="4479240">minus</span> <span m="4479600">1</span> <span m="4479840">is</span> <span m="4480030">congruent</span> <span m="4480480">to</span> <span m="4480600">1.</span> <span m="4483000">So</span> <span m="4484040">we</span> <span m="4484200">have</span> <span m="4484880">that</span> <span m="4486380">m</span> <span m="4486720">prime</span> <span m="4487090">to</span> <span m="4487220">the</span> <span m="4487320">power</span> <span m="4487690">d</span> <span m="4488100">is</span> <span m="4488340">congruent</span> <span m="4488910">to</span> <span m="4489200">m</span> <span m="4490810">modulo</span> <span m="4491370">p,</span> <span m="4494280">if</span> <span m="4494730">m</span> <span m="4495010">is</span> <span m="4495250">not</span> <span m="4495490">congruent</span> <span m="4495960">to</span> <span m="4496040">0</span> <span m="4496420">modulo</span> <span m="4496820">p,</span> <span m="4497230">right?</span> <span m="4497460">Because</span> <span m="4497750">if</span> <span m="4497860">m</span> <span m="4498060">is</span> <span m="4498190">not</span> <span m="4498370">congruent</span> <span m="4498690">to</span> <span m="4498790">zero,</span> <span m="4499550">we</span> <span m="4499680">have</span> <span m="4499910">this</span> <span m="4500140">particular</span> <span m="4500530">equation.</span> <span m="4501150">We</span> <span m="4501380">plug</span> <span m="4501580">it</span> <span m="4501650">in</span> <span m="4501800">over</span> <span m="4502070">here,</span> <span m="4502750">this</span> <span m="4502970">all</span> <span m="4503150">cancels,</span> <span m="4504100">and</span> <span m="4504260">we</span> <span m="4504370">just</span> <span m="4505120">are</span> <span m="4505290">left</span> <span m="4505580">with</span> <span m="4505780">m.</span> </p>
<p><span m="4506840">Now,</span> <span m="4507040">if</span> <span m="4507180">m</span> <span m="4507450">is</span> <span m="4508450">equal--</span> <span m="4509020">is</span> <span m="4509330">congruent--</span> <span m="4509760">to</span> <span m="4509840">0</span> <span m="4510210">modulo</span> <span m="4511150">p,</span> <span m="4512080">then</span> <span m="4513820">we</span> <span m="4513950">can</span> <span m="4514120">see</span> <span m="4514800">that</span> <span m="4514950">it</span> <span m="4515080">is</span> <span m="4515170">equal</span> <span m="4515420">to</span> <span m="4515500">0.</span> <span m="4516050">So</span> <span m="4516460">it's</span> <span m="4516630">equal</span> <span m="4516840">to</span> <span m="4516920">0.</span> <span m="4518210">So</span> <span m="4518370">this</span> <span m="4518580">actually</span> <span m="4518900">holds</span> <span m="4519350">for</span> <span m="4519590">any</span> <span m="4519880">case.</span> <span m="4521600">Now</span> <span m="4521750">we</span> <span m="4521850">can</span> <span m="4522020">do</span> <span m="4522120">the</span> <span m="4522240">same</span> <span m="4522650">for</span> <span m="4524100">q--</span> <span m="4525560">the</span> <span m="4525660">same</span> <span m="4525980">argument--</span> <span m="4527680">and</span> <span m="4527870">show</span> <span m="4528450">that</span> <span m="4528610">this</span> <span m="4528810">must</span> <span m="4529070">hold.</span> <span m="4530680">So</span> <span m="4530890">now</span> <span m="4531140">we</span> <span m="4531250">know</span> <span m="4532440">that</span> <span m="4532690">p</span> <span m="4533030">divides</span> <span m="4533630">the</span> <span m="4533710">difference</span> <span m="4535110">of</span> <span m="4535330">m</span> <span m="4535610">prime</span> <span m="4535960">d</span> <span m="4536450">minus</span> <span m="4536860">m.</span> <span m="4538225">q</span> <span m="4538680">is</span> <span m="4538820">another</span> <span m="4539160">prime</span> <span m="4539690">that</span> <span m="4539880">divides</span> <span m="4540320">this</span> <span m="4540500">difference.</span> <span m="4543190">And</span> <span m="4543350">the</span> <span m="4543500">only</span> <span m="4543810">way</span> <span m="4543960">that's</span> <span m="4544450">possible</span> <span m="4546330">is</span> <span m="4547190">if</span> <span m="4547490">the</span> <span m="4547620">product</span> <span m="4548130">of</span> <span m="4548370">p</span> <span m="4548600">and</span> <span m="4548760">q</span> <span m="4549280">is</span> <span m="4549560">dividing</span> <span m="4551750">this</span> <span m="4552140">particular</span> <span m="4552570">number--</span> <span m="4553530">this</span> <span m="4553710">difference.</span> <span m="4555130">And</span> <span m="4555270">we</span> <span m="4555360">have</span> <span m="4555590">two</span> <span m="4555950">different</span> <span m="4556350">primes</span> <span m="4556980">dividing</span> <span m="4557470">the</span> <span m="4557550">same</span> <span m="4557860">number,</span> <span m="4558230">so</span> <span m="4558390">the</span> <span m="4558510">product</span> <span m="4558930">must</span> <span m="4559650">[? divided. ?]</span> <span m="4560290">So</span> <span m="4560520">p</span> <span m="4560830">times</span> <span m="4561280">q</span> <span m="4562290">divides</span> <span m="4563620">m</span> <span m="4564040">prime</span> <span m="4564750">d</span> <span m="4566320">minus</span> <span m="4567030">m.</span> <span m="4568770">Oh,</span> <span m="4569030">but</span> <span m="4569280">p</span> <span m="4569420">times</span> <span m="4569710">q</span> <span m="4569860">is</span> <span m="4569980">equal</span> <span m="4570180">to</span> <span m="4570410">n.</span> <span m="4572040">So</span> <span m="4572220">now</span> <span m="4572490">we're</span> <span m="4572700">almost</span> <span m="4573230">done,</span> <span m="4573590">because</span> <span m="4573950">now</span> <span m="4574100">we</span> <span m="4574230">can</span> <span m="4574410">state--</span> <span m="4574876">by</span> <span m="4575342">the</span> <span m="4575810">definition</span> <span m="4576490">of</span> <span m="4576620">congruency--</span> <span m="4578010">that</span> <span m="4578930">m</span> <span m="4579210">prime</span> <span m="4579870">to</span> <span m="4579960">the</span> <span m="4580070">power</span> <span m="4580400">d</span> <span m="4581050">is</span> <span m="4581320">congruent</span> <span m="4581860">to</span> <span m="4582080">m</span> <span m="4583140">modulo</span> <span m="4585060">n.</span> </p>
<p><span m="4586350">Now,</span> <span m="4586490">since</span> <span m="4586930">m</span> <span m="4587490">is</span> <span m="4587680">a</span> <span m="4587760">message</span> <span m="4588290">that's</span> <span m="4588600">in</span> <span m="4588710">the</span> <span m="4588830">range</span> <span m="4590910">of--</span> <span m="4591530">so</span> <span m="4591870">I</span> <span m="4591950">did</span> <span m="4592040">not</span> <span m="4592200">write</span> <span m="4592390">it</span> <span m="4592520">down</span> <span m="4592790">here--</span> <span m="4593100">so</span> <span m="4593370">m</span> <span m="4593610">is</span> <span m="4594360">a</span> <span m="4594490">message</span> <span m="4595030">which</span> <span m="4595200">is</span> <span m="4595320">in</span> <span m="4595380">the</span> <span m="4595530">range</span> <span m="4596405">of</span> <span m="4596740">0</span> <span m="4597560">all</span> <span m="4597750">the</span> <span m="4597840">way</span> <span m="4598060">up</span> <span m="4598200">to</span> <span m="4598350">n</span> <span m="4598530">minus</span> <span m="4598920">1.</span> <span m="4600440">We</span> <span m="4600580">know,</span> <span m="4600910">and</span> <span m="4601220">we</span> <span m="4601320">have</span> <span m="4601400">seen</span> <span m="4601610">it</span> <span m="4601760">before</span> <span m="4602140">with</span> <span m="4602300">Turing's</span> <span m="4602620">code,</span> <span m="4603440">that</span> <span m="4603570">we</span> <span m="4603660">can</span> <span m="4603870">rewrite</span> <span m="4604350">this</span> <span m="4605470">and</span> <span m="4605620">say</span> <span m="4606000">that</span> <span m="4606190">m</span> <span m="4606640">equals</span> <span m="4607200">the</span> <span m="4607300">remainder</span> <span m="4609240">of</span> <span m="4609590">m</span> <span m="4610050">prime</span> <span m="4610380">to</span> <span m="4610510">the</span> <span m="4610620">power</span> <span m="4610960">d,</span> <span m="4612150">after</span> <span m="4612480">multiplying</span> <span m="4613220">out</span> <span m="4613360">as</span> <span m="4613560">many</span> <span m="4613840">multiples</span> <span m="4614430">of</span> <span m="4614640">n</span> <span m="4614810">as</span> <span m="4614940">possible.</span> </p>
<p><span m="4617100">So</span> <span m="4617290">here</span> <span m="4617480">you</span> <span m="4617540">go.</span> <span m="4618060">So</span> <span m="4618270">this</span> <span m="4618520">is</span> <span m="4619020">the</span> <span m="4619140">decryption</span> <span m="4620590">rule,</span> <span m="4621480">and</span> <span m="4621660">it</span> <span m="4621810">works.</span> <span m="4622180">We have</span> <span m="4622310">shown</span> <span m="4622620">that</span> <span m="4622710">this</span> <span m="4623240">equation</span> <span m="4623860">truly</span> <span m="4624180">holds.</span> <span m="4626640">So</span> <span m="4627240">RSA</span> <span m="4627640">has</span> <span m="4627840">really</span> <span m="4628050">withstood</span> <span m="4628710">the</span> <span m="4628870">test</span> <span m="4629140">of</span> <span m="4629280">time.</span> <span m="4630250">It's</span> <span m="4630430">already</span> <span m="4630790">out</span> <span m="4631020">there</span> <span m="4631160">for</span> <span m="4631600">many</span> <span m="4631930">decades,</span> <span m="4633250">and</span> <span m="4633520">it's</span> <span m="4633660">still</span> <span m="4633900">widely</span> <span m="4634300">used.</span> <span m="4635440">I</span> <span m="4635530">wanted</span> <span m="4635700">to</span> <span m="4635860">talk</span> <span m="4636100">a</span> <span m="4636120">little</span> <span m="4636280">bit</span> <span m="4636450">about</span> <span m="4636730">this,</span> <span m="4637030">but</span> <span m="4637470">there</span> <span m="4637780">seemed</span> <span m="4638280">not</span> <span m="4638490">to</span> <span m="4638580">be</span> <span m="4638770">enough</span> <span m="4639240">time.</span> </p>
<p><span m="4639580">But I'd</span> <span m="4639870">just</span> <span m="4640120">like</span> <span m="4640290">to</span> <span m="4640410">mention</span> <span m="4641420">that</span> <span m="4643350">only</span> <span m="4643670">2009</span> <span m="4645600">Craig</span> <span m="4645880">Gentry</span> <span m="4646570">proved</span> <span m="4647240">a</span> <span m="4647350">beautiful</span> <span m="4647830">theorem,</span> <span m="4648940">and</span> <span m="4649370">was</span> <span m="4649630">able</span> <span m="4650630">to</span> <span m="4650990">evaluate</span> <span m="4652250">Boolean</span> <span m="4652620">circuits.</span> <span m="4653250">Or,</span> <span m="4653960">say,</span> <span m="4654610">certain</span> <span m="4654900">types</span> <span m="4655100">of</span> <span m="4655200">programs</span> <span m="4656300">under</span> <span m="4656440">encryption.</span> <span m="4657650">So</span> <span m="4657930">you</span> <span m="4658080">can</span> <span m="4658260">sort</span> <span m="4658480">of</span> <span m="4658650">add</span> <span m="4658950">and</span> <span m="4659050">multiply</span> <span m="4660130">cypher</span> <span m="4660590">text</span> <span m="4661040">encryptions</span> <span m="4661610">together,</span> <span m="4662470">and</span> <span m="4662620">it</span> <span m="4662750">is</span> <span m="4662910">as</span> <span m="4663190">if</span> <span m="4664050">you</span> <span m="4664180">multiply</span> <span m="4664730">them</span> <span m="4665310">at</span> <span m="4665480">the</span> <span m="4665580">plain</span> <span m="4665900">text</span> <span m="4666210">level.</span> <span m="4666700">That</span> <span m="4666830">was</span> <span m="4667000">a</span> <span m="4667050">fantastic--</span> <span m="4668920">that</span> <span m="4669060">was</span> <span m="4669200">an</span> <span m="4669410">enormous</span> <span m="4669900">open</span> <span m="4670160">problem.</span> <span m="4670720">And he</span> <span m="4671095">solved it.</span> <span m="4672030">And</span> <span m="4672410">only</span> <span m="4672650">a</span> <span m="4672690">few</span> <span m="4672890">months</span> <span m="4673320">earlier,</span> <span m="4674120">in</span> <span m="4674290">2010,</span> <span m="4675850">in</span> <span m="4676000">joint</span> <span m="4676310">work</span> <span m="4676540">with</span> <span m="4676720">Craig</span> <span m="4677080">and</span> <span m="4677180">some</span> <span m="4677350">other</span> <span m="4677550">colleagues</span> <span m="4678760">at</span> <span m="4678930">IBM,</span> <span m="4679810">we</span> <span m="4679910">showed</span> <span m="4680250">it</span> <span m="4680370">with</span> <span m="4680660">very</span> <span m="4681070">simple</span> <span m="4681520">arithmetic</span> <span m="4682570">that</span> <span m="4682860">just</span> <span m="4683280">uses</span> <span m="4683690">modulo</span> <span m="4684210">p</span> <span m="4684580">and</span> <span m="4684730">modulo</span> <span m="4684920">2</span> <span m="4685690">kind</span> <span m="4685970">of</span> <span m="4686160">things.</span> <span m="4687120">We</span> <span m="4687260">could</span> <span m="4687430">show</span> <span m="4688220">a</span> <span m="4688420">construction</span> <span m="4691290">this</span> <span m="4691450">has</span> <span m="4691630">such</span> <span m="4691860">a</span> <span m="4691910">property--</span> <span m="4692790">such</span> <span m="4693020">an</span> <span m="4693090">encryption</span> <span m="4693490">scheme</span> <span m="4693820">of the</span> <span m="4694060">integers.</span> </p>
<p><span m="4695100">So</span> <span m="4695280">there's</span> <span m="4695450">still</span> <span m="4695810">a</span> <span m="4695830">lot</span> <span m="4696010">of</span> <span m="4696240">stuff</span> <span m="4696530">going</span> <span m="4696820">on</span> <span m="4697000">in</span> <span m="4697070">this</span> <span m="4697260">area.</span> <span m="4698130">And</span> <span m="4698480">really,</span> <span m="4698960">we</span> <span m="4699140">use</span> <span m="4699380">this</span> <span m="4699620">type</span> <span m="4699870">of</span> <span m="4700130">very</span> <span m="4700400">basic</span> <span m="4700870">stuff.</span> <span m="4701780">The</span> <span m="4701890">problem</span> <span m="4702280">in</span> <span m="4702700">cryptography</span> <span m="4703470">is</span> <span m="4703680">to</span> <span m="4703790">show</span> <span m="4704200">that</span> <span m="4704420">it is</span> <span m="4704530">secure.</span> <span m="4705450">So</span> <span m="4705600">you have</span> <span m="4705740">to</span> <span m="4705810">show</span> <span m="4706250">that</span> <span m="4707210">breaking</span> <span m="4707610">the</span> <span m="4707700">scheme</span> <span m="4708330">needs</span> <span m="4708630">to</span> <span m="4708980">be</span> <span m="4709150">reduced</span> <span m="4709850">to</span> <span m="4710360">some</span> <span m="4710630">really</span> <span m="4710910">hard</span> <span m="4711190">problem.</span> <span m="4712190">And</span> <span m="4712280">that</span> <span m="4712440">is</span> <span m="4713190">always</span> <span m="4713630">the</span> <span m="4713690">really</span> <span m="4714230">difficult</span> <span m="4714640">part</span> <span m="4714920">of</span> <span m="4715360">such</span> <span m="4715590">type</span> <span m="4715800">of</span> <span m="4715890">research.</span> <span m="4717200">OK,</span> <span m="4717490">well,</span> <span m="4718060">have</span> <span m="4718390">lots</span> <span m="4718640">of</span> <span m="4718960">fun</span> <span m="4719460">with</span> <span m="4719570">recitation.</span> </p>
</div>
        <div id="vid_related" itemprop="description" class="tabContent hide">
<h2 class="subhead">Free Downloads</h2>
<h3 class="subsubhead">Video</h3>
<ul>
<li>iTunes U (<a href="http://itunes.apple.com/us/itunes-u/lecture-5-number-theory-ii/id503873536?i=110644960">MP4 - 172MB</a>)</li>
<li>Internet Archive (<a href="http://www.archive.org/download/MIT6.042JF10/MIT6_042JF10_lec05_300k.mp4">MP4 - 172MB</a>)</li>
</ul>
<br>
<h3 class="subsubhead">Caption</h3>
<ul>
<li>English-US (<a href="../../../contents/video-lectures/lecture-5-number-theory-ii/XX7ePR21Ook.srt">SRT</a>)</li>
</ul>
</div>
    
   </div>  




      					 
        <div class="" id="parent-fieldname-bottom_html_area">
            
            
        </div>
    
               </main><!--Course_inner_media tag close -->
           		</div>
<!--Course_wrapper tag close -->
            </div>
<!--left tag close -->
            <aside id="right">
                <!--Begin Right Portion -->
                    <div>
    



</div>

                	<div>
    



</div>


        <div class="" id="parent-fieldname-rsi_top_html_area">
            
            
        </div>
    

<!-- RSI google ad space-->



<div id="google_ads">    
    <script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script>
    <script type="text/javascript">var googletag = googletag || {}; googletag.cmd = googletag.cmd || [];</script>
    <script type="text/javascript">
googletag.cmd.push(function() {googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_A_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_A_DL').addService(googletag.pubads());googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_B_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_B_DL').addService(googletag.pubads());googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_C_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_C_DL').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
 googletag.enableServices();
});</script>
    <script language="javascript" type="text/javascript">
googletag.cmd.push(function() {googletag.pubads().set("TYPE","HOUSE");googletag.pubads().set("DEPARTMENT","6");googletag.pubads().set("CRS_BEG2","04");googletag.pubads().set("CRS_END","2J");googletag.pubads().set("SESSION","F");googletag.pubads().set("YEAR","10");})
</script>
    
    <div id="VIDEO_INDIVIDUAL_SLOT_A_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_A_DL'); });</script>
    </div>
    <div id="VIDEO_INDIVIDUAL_SLOT_B_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_B_DL'); });</script>
    </div>
    <div id="VIDEO_INDIVIDUAL_SLOT_C_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_C_DL'); });</script>
    </div>
</div>

<!-- End RSI ads--> 


<div>
    



</div>

            </aside><!--Right div close -->
            <div class="clear"></div>
        </div>
<!--grid tag close -->
      </div>
		
		<footer id="bottom">
			<div id="grid">
				
<div id="portletwrapper-6f63772e626f74746f6d706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d666f6f746572" class="portletWrapper kssattr-portlethash-6f63772e626f74746f6d706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d666f6f746572">
<div class="portletStaticText portlet-static-site-footer"><div id="footer">
<nav aria-label="Footer">     <nav id="foot-c1" class="grid_2 alpha" aria-labelledby="f-find-courses">       <span class="footer" id="f-find-courses" aria-hidden="true">Find Courses</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/courses/find-by-topic/">Find by Topic</a></li>
    <li><a href="https://ocw.mit.edu/courses/find-by-number/">Find by Course Number</a></li>
    <li><a href="https://ocw.mit.edu/courses/find-by-department/">Find by Department</a></li>
    <li><a href="https://ocw.mit.edu/courses/new-courses/">New Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/most-visited-courses/">Most Visited Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/ocw-scholar/">OCW Scholar Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/audio-video-courses/">Audio/Video Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/online-textbooks/">Online Textbooks</a></li>
    <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights</a></li>
    <li><a href="https://ocw.mit.edu/resources/">Supplemental Resources</a></li>
    <li><a href="https://ocw.mit.edu/courses/mitx-related-courseware/">MITx &amp; Related OCW Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/mit-open-learning-library/">MIT Open Learning Library</a></li>
    <li><a href="https://ocw.mit.edu/courses/translated-courses/">Translated Courses</a></li>
</ul>
</nav>
<div id="foot-c2" class="grid_2"><nav aria-labelledby="f-for-educators">         <span id="f-for-educators" class="footer" aria-hidden="true">For Educators</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://chalk-radio.simplecast.com/">Chalk Radio Podcast</a></li>
    <li><a href="https://ocw.mit.edu/educator/">OCW Educator Portal </a></li>
    <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights by Department</a></li>
    <li><a href="https://openlearning.mit.edu/campus/digital-innovations/" aria-label="External Link: Residential Digital Innovations">Residential Digital Innovations </a></li>
    <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
    <li><a href="https://ocw.mit.edu/educator/additional-resources/">Additional Resources</a></li>
</ul>
</nav></div>
<nav class="grid_2" id="foot-c3" aria-labelledby="f-donate">       <span id="f-donate" class="footer" aria-hidden="true">Give Now</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/give/">Make a Donation</a></li>
    <li><a href="https://ocw.mit.edu/give/why-give/">Why Give?</a></li>
    <li><a href="https://ocw.mit.edu/give/our-supporters/">Our Supporters</a></li>
    <li><a href="https://ocw.mit.edu/give/other-ways-to-contribute/">Other Ways to Contribute</a></li>
    <li><a href="https://ocw.mit.edu/support/">Become a Corporate Sponsor</a></li>
</ul>
</nav>
<div class="grid_2" id="foot-c4">
<nav aria-labelledby="f-about">         <span id="f-about" class="footer" aria-hidden="true">About</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/about/">About OpenCourseWare</a></li>
    <li><a href="https://ocw.mit.edu/about/site-statistics/">Site Statistics</a></li>
    <li><a href="https://ocw.mit.edu/about/ocw-stories/">OCW Stories</a></li>
    <li><a href="https://ocw.mit.edu/about/newsletter/">Newsletter</a></li>
    <li><a href="https://www.ocw-openmatters.org/">Open Matters Blog</a></li>
</ul>
</nav><!--about-->       <nav aria-labelledby="f-tools">         <span id="f-tools" class="footer" aria-hidden="true">Tools</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/help/">Help &amp; FAQs</a></li>
    <li><a href="https://ocw.mit.edu/about/contactus">Contact Us</a></li>
    <li><a href="https://accessibility.mit.edu/" target="_blank">Accessibility</a></li>
    <li><a href="https://ocw.mit.edu/help/site-map/">Site Map</a></li>
    <li><a href="../../../common/terms/index.htm">Privacy &amp; Terms of Use</a></li>
    <li><a href="https://ocw.mit.edu/help/rss/">RSS Feeds</a></li>
</ul>
</nav><!--tools-->
</div>
</nav> <aside style="min-height: 289px;" aria-labelledby="f-our-corporate-supporters" class="grid_4 omega" id="foot-c5">           <span aria-hidden="true" class="footer" id="f-our-corporate-supporters">Our Corporate Supporters</span>           <!-- HOME_CORP_LOGO_1 -->
<div id="div-gpt-ad-1388181177156-0" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-0'); });
            </script></div>
<!-- HOME_CORP_LOGO_2 -->
<div id="div-gpt-ad-1388181177156-1" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-1'); });
            </script></div>
<!-- HOME_CORP_LOGO_3 -->
<div id="div-gpt-ad-1388181177156-2" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-2'); });
            </script></div>
<!-- HOME_CORP_LOGO_4 -->
<div id="div-gpt-ad-1388181177156-3" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-3'); });
            </script></div>
<!-- HOME_CORP_LOGO_5 -->
<div id="div-gpt-ad-1388181177156-4" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-4'); });
              </script></div>
<!-- HOME_CORP_LOGO_6 -->
<div id="div-gpt-ad-1388181177156-5" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-5'); });
              </script></div>
</aside>
<div class="grid_12 alpha omega" itemprop="publisher" itemscope="" itemtype="http://schema.org/CollegeOrUniversity">
<h4 class="footer" style="border-top: thin solid #d5c9ba; padding-top: 10px; margin-bottom: 10px;">About <span itemprop="name">MIT OpenCourseWare</span>
</h4>
<p style="color: #999; font-size: 1em; line-height: 1.5em; margin-top: 10px;" itemprop="description">MIT OpenCourseWare is an online publication of materials from over 2,500 MIT courses, freely sharing knowledge with learners and educators around the world. <a href="https://ocw.mit.edu/about/">Learn more »</a></p>
</div>
<div id="foot-copy" class="grid_12 alpha omega" style="border-top: none;">
<a href="http://web.mit.edu"><img src="../../../common/images/logo_mit.png" alt="Massachusetts Institute of Technology logo and name." style="width: 195; height: 44;"></a><a href="https://openlearning.mit.edu/"><img src="https://ocw.mit.edu/images/mitol_logo.png" alt="MIT Open Learning logo and name." style="width: 265; height: 50; vertical-align: top; padding-left:30px;"></a><a href="https://www.oeglobal.org/"><img src="https://ocw.mit.edu/images/oeg_logo.gif" alt="Open Education Consortium logo." style="width: 219px; height: 59px; vertical-align: top; padding-left:20px;"></a><a rel="license" itemprop="useRightsUrl" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="../../../common/images/cc_by-nc-sa.png" alt="Creative Commons logo with terms BY-NC-SA." style="width: 126px; height: 44px; margin-right: 0; padding-left: 20px;"></a>
<p class="copyright">© 2001–2018<br>
Massachusetts Institute of Technology</p>
<p style="font-size: 0.9em; margin-bottom: 15px;">Your use of the MIT OpenCourseWare site and materials is subject to our <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license">Creative Commons License</a> and other <a href="../../../common/terms/index.htm" rel="cc:morePermissions">terms of use</a>.</p>
</div>
</div></div>

</div>





                
			</div> <!-- bottom grid end -->
		</footer><!-- footer bottom end -->


   </body>
 </html>
